atomes 1.1.14
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
global.h
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2024 by CNRS and University of Strasbourg */
15
24/*
25* This header file: 'global.h'
26*
27* Contains:
28
29 - Global variable declarations
30 - Global convenience function declarations
31 - Global data structure definitions
32
33*/
34
35#ifdef HAVE_CONFIG_H
36# include <config.h>
37#endif
38
39#define GDK_SYNCHRONIZE
40
41#ifndef GLOBAL_H_
42
43#define GLOBAL_H_
44
45#include <glib.h>
46#include <glib/gi18n.h>
47#include <locale.h>
48#include <unistd.h>
49#include <string.h>
50#include <stdio.h>
51#include <stdlib.h>
52#include <sys/types.h>
53#include <sys/stat.h>
54#include <math.h>
55
56#include <gtk/gtk.h>
57#include <gdk/gdk.h>
58#include <gdk/gdkkeysyms.h>
59#include <gdk-pixbuf/gdk-pixbuf.h>
60
61#include <pango/pangoft2.h>
62
63#ifdef MAC_INTEGRATION
64# include <gtkosxapplication.h>
65#endif
66
67#ifdef G_OS_WIN32
68# include <windef.h>
69# include <windows.h>
70# define WIN32_LEAN_AND_MEAN 1
71# include <epoxy/gl.h>
72# include <GL/glu.h>
73#else
74# define max(a,b) (a>=b?a:b)
75# define min(a,b) (a<=b?a:b)
76# include <epoxy/gl.h>
77# ifdef __APPLE__
78# include <OpenGL/glu.h>
79# else
80# include <GL/glu.h>
81# include <epoxy/glx.h>
82# endif
83#endif
84
85#include "math_3d.h"
86
87// dint, tint and qint structures are used for pointer purposes.
88// dint, tint, qint, ColRGBA and coord_info structures must be defined before including 'glwin.h'
89typedef struct dint dint;
90struct dint
91{
92 int a;
93 int b;
94};
95
96typedef struct tint tint;
97struct tint
98{
99 int a;
100 int b;
101 int c;
102};
103
104typedef struct qint qint;
105struct qint
106{
107 int a;
108 int b;
109 int c;
110 int d;
111};
112
113typedef struct ColRGBA ColRGBA;
115{
116 float red;
117 float green;
118 float blue;
119 float alpha;
120};
121
125typedef struct coord_info coord_info;
127{
129 // 0 = tot
130 // 1 = partial
131 // 2 = fragments
132 // 3 = molecules
133 // > 3 = rings
134 // 9 = chains
135 int totcoord[10];
142 int * ntg[10];
143 int ** geolist[10];
144 int *** partial_geo;
145 int cmin;
146 int cmax;
147};
148
149#include "glwin.h"
150
151#ifndef GTK4
152# include <gtk/gtkx.h>
153#endif
154#define MEDIA_NEXT "media-skip-forward"
155#define MEDIA_PREV "media-skip-backward"
156#define MEDIA_LAST "go-last"
157#define MEDIA_FIRST "go-first"
158#define MEDIA_GOTO "go-jump"
159#define MEDIA_PLAY "media-playback-start"
160#define MEDIA_STOP "media-playback-stop"
161#define MEDIA_LOOP "view-refresh"
162#define MEDIA_ULOOP "edit-cut"
163#define MEDIA_SLOW "view-sort-ascending"
164#define MEDIA_FAST "view-sort-descending"
165#define GO_RIGHT "go-next"
166#define GO_LEFT "go-previous"
167#define GO_UP "go-up"
168#define GO_DOWN "go-down"
169#define PAGE_SETUP "document-page-setup"
170#define FULLSCREEN "view-fullscreen"
171#define FITBEST "zoom-fit-best"
172#define RECORD "media-record"
173#define YES "gtk-yes"
174#define EDITA "edit-find-replace"
175#define EDITC "edit-copy"
176#define EDITF "edit-find"
177#define ECUT "edit-cut"
178#define DPROPERTIES "document-properties"
179#define FNEW "document-new"
180#define FOPEN "document-open"
181#define FSAVE "document-save"
182#define FSAVEAS "document-save-as"
183#define FCLOSE "window-close"
184#define FEXIT "application-exit"
185#define LIST_ADD "list-add"
186#define LIST_REM "list-remove"
187#define CANCEL "process-stop"
188#define EXECUTE "system-run"
189#ifdef GTK4
190#define APPLY "emblem-default"
191#else
192#define APPLY "gtk-apply"
193#endif
194#define DELETEB "edit-delete"
195#define DIAL_ERROR "dialog-error"
196#define AFILE "text-x-generic"
197#define ABOUT "help-about"
198
199#ifdef GTK4
201enum ReliefStyle {
202 GTK_RELIEF_NORMAL = 0,
203 GTK_RELIEF_HALF = 1,
204 GTK_RELIEF_NONE = 2
205};
206
208enum ShadowStyle {
209 GTK_SHADOW_NONE = 0,
210 GTK_SHADOW_IN = 1,
211 GTK_SHADOW_OUT = 2,
212 GTK_SHADOW_ETCHED_IN = 3,
213 GTK_SHADOW_ETCHED_OUT = 4
214};
215#define BSEP 3
216#else
217#define BSEP 0
218#endif
219
229
238
239#define IODEBUG FALSE
240
244#define ATOM_LIMIT 100000
245
249#define STEP_LIMIT 10000
250
251#define OK 0
252#define ERROR_RW 1
253#define ERROR_PROJECT 2
254#define ERROR_CURVE 3
255#define ERROR_IMAGE 4
256#define ERROR_ATOM_A 5
257#define ERROR_ATOM_B 6
258#define ERROR_UPDATE 7
259#define ERROR_NO_WAY 8
260#define ERROR_COORD 9
261#define ERROR_RINGS 10
262#define ERROR_CHAINS 11
263#define ERROR_MOL 12
264
268#define CHEM_PARAMS 5
269#define CHEM_Z 0
270#define CHEM_M 1
271#define CHEM_R 2
272#define CHEM_N 3
273#define CHEM_X 4
274
275#define NDOTS 8
276
280#define NCALCS 12
281
285#define NGRAPHS 10
286
290#define NCFORMATS 12
291
292#define NITEMS 16
293#define OT 4
294#define GR 0
295#define SQ 1
296#define SK 2
297#define GK 3
298#define BD 4
299#define AN 5
300#define RI 6
301#define CH 7
302#define SP 8
303#define MS 9
304#define BV 10
305#define FF 12
306
307#define DEFAULT_FONT_SIZE 8
308#define DEFAULT_ALPHA 0.75
309#define MINCUT 1.85
310
311#ifdef G_OS_WIN32
312extern gchar * PACKAGE_PREFIX;
313extern gchar * PACKAGE_LIB_DIR;
314extern gchar * PACKAGE_DATA_DIR;
315extern gchar * PACKAGE_LOCALE_DIR;
316extern gchar * PACKAGE_IMP;
317extern gchar * PACKAGE_CON;
318extern gchar * PACKAGE_IMG;
319extern gchar * PACKAGE_PDF;
320extern gchar * PACKAGE_SVG;
321extern gchar * PACKAGE_EPS;
322extern gchar * PACKAGE_PNG;
323extern gchar * PACKAGE_JPG;
324extern gchar * PACKAGE_BMP;
325extern gchar * PACKAGE_TIFF;
326extern gchar * PACKAGE_VOID;
327extern gchar * PACKAGE_GR;
328extern gchar * PACKAGE_SQ;
329extern gchar * PACKAGE_BD;
330extern gchar * PACKAGE_AN;
331extern gchar * PACKAGE_RI;
332extern gchar * PACKAGE_CH;
333extern gchar * PACKAGE_SP;
334extern gchar * PACKAGE_MS;
335extern gchar * PACKAGE_TD;
336extern gchar * PACKAGE_MOL;
337extern gchar * PACKAGE_OGL;
338extern gchar * PACKAGE_OGLM;
339extern gchar * PACKAGE_OGLC;
340extern gchar * PACKAGE_PRO;
341extern gchar * PACKAGE_SET;
342extern gchar * PACKAGE_LOGO;
343extern gchar * PACKAGE_LAGPL;
344extern gchar * PACKAGE_LABOUT;
345extern gchar * PACKAGE_DOTA;
346extern gchar * PACKAGE_DOTB;
347extern gchar * PACKAGE_DOTC;
348extern gchar * PACKAGE_DOTD;
349extern gchar * PACKAGE_DOTE;
350extern gchar * PACKAGE_DOTF;
351extern gchar * PACKAGE_DOTG;
352extern gchar * PACKAGE_DOTH;
353extern gchar * PACKAGE_DFBD;
354extern gchar * PACKAGE_DFAN;
355extern gchar * PACKAGE_DFDI;
356extern gchar * PACKAGE_DFTD;
357extern gchar * PACKAGE_DFIN;
358extern gchar * PACKAGE_SGCP;
359extern gchar * PACKAGE_SGCI;
360extern gchar * PACKAGE_SGCF;
361extern gchar * PACKAGE_SGHP;
362extern gchar * PACKAGE_SGTR;
363extern gchar * PACKAGE_SGTI;
364extern gchar * PACKAGE_SGTP;
365extern gchar * PACKAGE_SGOP;
366extern gchar * PACKAGE_SGOI;
367extern gchar * PACKAGE_SGOC;
368extern gchar * PACKAGE_SGOF;
369extern gchar * PACKAGE_SGMP;
370extern gchar * PACKAGE_SGMI;
371extern gchar * PACKAGE_SGTC;
372#endif
373extern gchar * ATOMES_CONFIG;
374extern gchar * ATOMES_URL;
375
376extern gchar * mode_name[2];
377extern gchar * graph_img[NGRAPHS];
378extern gchar * dots[NDOTS];
379extern gchar * bravais_img[14];
380extern gchar * ifield[8];
381extern gchar * projfile;
382extern char * ifbug;
383extern char * coord_files[NCFORMATS+1];
384extern char * coord_files_ext[NCFORMATS+1];
385extern char * calc_name[NCALCS-2];
386extern char * graph_name[NGRAPHS] ;
387extern char * rings_type[5];
388extern char * untime[6];
389extern gchar * workspacefile;
390
391extern int nprojects;
392extern int activep;
393extern int activev;
394extern int activef;
395extern int inactep;
396extern int activew;
397extern int statusval;
398extern int atomes_visual;
399extern int dialog_id;
400
401extern int bonds_update;
402extern int frag_update;
403extern int mol_update;
404
405extern int tmp_pixels[2];
406extern int * pasted_todo;
408
409extern GMainLoop * Event_loop[5];
410
411extern gboolean in_movie_encoding;
412extern gboolean newspace;
413extern gboolean reading_input;
414extern gboolean tmp_adv_bonding[2];
415extern gboolean column_label;
416extern gboolean check_label;
417extern gboolean object_motion;
418extern gboolean selected_status;
419extern gboolean silent_input;
420extern gboolean cif_use_symmetry_positions;
421
422extern struct timespec start_time;
423extern struct timespec stop_time;
424
425extern double opac;
426extern double pi;
427
428extern GtkWidget * MainWindow;
429extern GtkWidget * MainView;
430extern GtkWidget * MainFrame[2];
431extern GtkWidget * pop;
432extern GtkWidget * curvetoolbox;
433extern GtkWidget * progressbar;
434extern GtkWidget * MainScrol[2];
435extern GtkWidget * atomes_logo;
436extern GtkWidget * calc_dialog;
437extern GtkWidget * register_button;
438
439extern GtkTextTag * tag;
440extern GtkStatusbar * statusbar;
441
442extern ColRGBA std[6];
443
444extern GdkPixbuf * THETD;
445extern GdkPixbuf * THEMO;
446extern GdkPixbuf * THEBD;
447extern GdkPixbuf * SETTING;
448extern GdkPixbuf * SETTINGS;
449extern GdkPixbuf * OGL;
450extern GdkPixbuf * OGLM;
451extern GdkPixbuf * OGLC;
452extern GdkPixbuf * RUN;
453
454extern tint cut_sel;
455extern tint cut_lab;
456
457// Data structures
458#define LINE_SIZE 160
459
461typedef struct line_node line_node;
463{
464 gchar * line;
465 struct line_node * next;
466 struct line_node * prev;
467};
468
472typedef struct coord_file coord_file;
474{
476 int steps;
477 int nspec;
478 double * z;
479 int * nsps;
480 double ** coord;
481 gboolean cartesian;
482 int * lot;
483 int ndummy;
484 gchar ** dummy;
486 int mid;
487 gchar * info;
488 gchar ** label;
489 // The following line is only used for DL_POLY history files:
490 int traj;
491 // The following lines are only used for CIF files:
493 gchar *** sym_pos;
495 int * wyckoff;
496 double * occupancy;
497 int ** occupied;
498 int * multi;
503};
504
508typedef struct MouseState MouseState;
510{
511 gint start_x;
512 gint start_y;
513 gint time;
514 gboolean MouseIsDown;
515};
516
520typedef struct CurveState CurveState;
526
530typedef struct DataLayout DataLayout;
532{
534 double thickness;
535 int dash;
536 int glyph;
537 double gsize;
538 int gfreq;
539 int aspect;
540 double hwidth;
541 double hopac;
542 int hpos;
543};
544
548typedef struct CurveExtra CurveExtra;
556
560typedef struct ExtraSets ExtraSets;
567
571typedef struct Curve Curve;
572struct Curve
573{
574 int cid;
575 int ndata;
576 double * data[2];
577 double * err;
578 double cmin[2];
579 double cmax[2];
580 GtkWidget * plot;
581 GtkWidget * button;
582 GtkWidget * curve_vbox;
583 GtkWidget * curve_hbox;
584 GtkWidget * window;
585 GtkWidget * pos;
586 int wsize[2];
587 GtkWidget * datatree;
590 int format;
591 char * name;
592// Axis
593 double axmin[2];
594 double axmax[2];
595 gboolean axis_defaut_title[2];
596 char * axis_title[2];
599 gchar * axis_title_font[2];
600 int scale[2];
601 gboolean autoscale[2];
602 gboolean show_grid[2];
603 gboolean show_axis[2];
604 double majt[2];
605 int mint[2];
606 int ticks_io[2];
607 int ticks_pos[2];
608 int majt_size[2];
609 int mint_size[2];
610 int labels_pos[2];
612 gchar * labels_font[2];
613 double labels_angle[2];
616 // Legend
617 gboolean show_legend;
618 double legend_pos[2];
619 gchar * legend_font;
625// Title
626 char * title;
627 gboolean show_title;
628 gboolean default_title;
629 double title_pos[2];
630 gchar * title_font;
632// Frame
633 gboolean show_frame;
638 double frame_pos[2][2];
642 cairo_surface_t * surface;
644 int bshift;
646 gboolean displayed;
647 char * cfile;
648 gchar * path;
651 GSimpleActionGroup * action_group;
652};
653
657#define MAXDATC 8
658
662#define MAXDATA 21
663
666{
667 gboolean prepare_file[2];
668 // Field and Config files
669 gboolean afp[MAXDATC+MAXDATA];
670 int type;
675 int nbody[5];
677 // Tersoff potential cross terms
678 double *** cross;
681
682 // Control file
683 double * sys_opts;
684 double * io_opts;
685 double * ana_opts;
686 double * elec_opts;
687 double * vdw_opts;
688 double * met_opts;
689 double * equi_opts;
692 double * thermo_opts;
693 double * md_opts;
694 double * out_opts;
695};
696
697typedef struct thermostat thermostat;
699{
700 int id;
701 // For CPMD: 0 = none, 2 = controlled, 3 = nose
702 // For CP2K: 0 = none, 2 = langevin, 3 = csvr, 4 = gle, 5 = nose
703 int type;
704 // For CPMD: 0 = global, 1 = local
705 // For CP2K: 0 = global, 1 = local, 2 = molecule
706 int sys;
708 double params[4];
710 int * list;
713};
714
715typedef struct dummy_atom dummy_atom;
717{
718 // 0 = type1, 1 = type2, ...
719 int id;
720 int type;
721 int pick[2];
723 double xyz[3];
724 int coord[4];
726 int * list;
727 int numv;
728 int * vois;
731};
732
733typedef struct cpmd cpmd;
751
752typedef struct cp2k cp2k;
753struct cp2k
754{
756 double opts[42];
757 double extra_opts[3][4];
760 int fixat[2];
761 int * fixlist[2];
762 int ** fixcoord[2];
763 gchar * files[5];
764 gchar *** spec_files;
765 int ** spec_data;
766 gchar * info;
767};
768
770typedef struct molecule molecule;
772{
773 int id;
774 int md;
776 int * fragments;
777 int natoms;
778 int nspec;
779 int * species;
780};
781
785typedef struct model model;
786struct model
787{
790};
791
797{
798 gchar * lab;
799 gchar * name;
800 int Z;
801 float M;
802};
803
806{
807 // 0 = Z, 1 = Mass, 2 = Radius, 3 = Neutrons, 4 = X-rays
808 double ** chem_prop;
814 int * nsps;
815 int * formula;
816 char ** label;
817 char ** element;
818 double ** cutoffs;
819 double grtotcutoff;
820};
821
827{
828 gchar * type;
829 gchar * object;
830 double Z;
831 int ats;
832};
833
837typedef struct atom atom;
838struct atom
839{
840 int id; // The id in the model
841 int sp; // The chemical species
842 // The coordinates
843 double x;
844 double y;
845 double z;
846 int numv; // The number of neighbors
847 int * vois; // The list of neighbors
848 // 0 = Total coordination
849 // 1 = Partial coordination
850 // 2 = Fragment
851 // 3 = Molecule
852 // 4 = Field object id
853 int coord[5];
859 // Coordination information
860 // 0 = All
861 // 1 = King's
862 // 2 = Guttman's
863 // 3 = Primitive
864 // 4 = Strong
865 int ** rings[5];
871 // Rings statistics information
872 int ** chain;
873 int fid;
874 int faid;
879 int style;
882};
883
887typedef struct project project;
889{
890 /*
891 General parameters
892 */
893 int id;
894 char * name;
895 char * projfile;
896 char * coordfile;
897 char * bondfile;
901 int tfile;
902 int nspec;
905 int steps;
906 int tunit;
911 /*
912 Analysis related parameters
913 */
917 int xcor;
919 // gr, sq, sk, gftt, bd, an, frag-mol, ch, sp, msd
923 double delta[NGRAPHS];
924 double min[NGRAPHS];
925 double max[NGRAPHS];
926 // 0 = Search type, 1 = NUMA
927 int rsearch[2];
928 // First col : search type (up to chains stat). Second col: search info
929 // 0 = Initnode, 1 = RMAX, 2 = ABAB, 3 = Homo, 4 = Homo in DMTX, 5 = Done + Rings
930 int rsparam[5][6];
937 double rsdata[5][5];
944 // 0 = Initnode, 1 = AAAA, 2 = ABAB, 3 = Homo, 4 = 1221, 5 = RMAX, 6 = Done + Chains
945 int csparam[7];
953 double csdata[2];
956 double fact[4];
957 double sk_advanced[2];
960 int numwid;
962 /*
963 OpenGL related parameters
964 */
966 int tmp_pixels[2];
968 /*
969 Molecular dynamics related parameters
970 */
972 // MD input files
977#ifdef DEBUG
978 GtkWidget * pix_tab[3];
980 int pix[3];
981 int ** pixels;
982 int actif_pix;
983#endif
984
987};
988
989typedef struct workspace workspace;
995
996extern gchar * edition_action_names[3];
997extern gchar * analyze_action_names[9];
998extern GSimpleAction * edition_actions[3];
999extern GSimpleAction * analyze_actions[9];
1000extern void add_action (GSimpleAction * action);
1001extern void remove_action (gchar * action_name);
1002extern void remove_edition_actions ();
1004
1005extern GtkApplication * AtomesApp;
1006extern workspace workzone;
1007extern project * proj;
1008extern chemical_data * active_chem;
1009extern coord_info * active_coord;
1010extern cell_info * active_cell;
1011extern box_info * active_box;
1012extern image * active_image;
1013extern glwin * active_glwin;
1014extern project * active_project;
1015extern project * opengl_project;
1017
1018extern project * get_project_by_id (int p);
1019extern void opengl_project_changed (int id);
1020extern gboolean in_md_shaders (project * this_proj, int id);
1021extern void recreate_all_shaders (glwin * view);
1022extern gboolean is_atom_win_active (glwin * view);
1023
1024// extern gboolean run_distance_matrix (GtkWidget * widg, int calc, int up_ngb);
1025extern G_MODULE_EXPORT void on_calc_bonds_released (GtkWidget * widg, gpointer data);
1026extern void update_rings_menus (glwin * view);
1027extern void clean_rings_data (int rid, glwin * view);
1028extern void clean_chains_data (glwin * view);
1029extern void clean_volumes_data (glwin * view);
1030
1031extern void initcutoffs (chemical_data * chem, int species);
1032extern void cutoffsend ();
1033extern void update_entry_int (GtkEntry * entry, int intval);
1034extern void update_entry_double (GtkEntry * entry, double doubleval);
1035extern void update_entry_long_double (GtkEntry * entry, double doubleval);
1036extern void update_entry_text (GtkEntry * entry, gchar * text);
1037
1038extern double * xsk;
1039extern gboolean * allocbool (int val);
1040extern gboolean ** allocdbool (int xal, int yal);
1041extern gboolean *** alloctbool (int xal, int yal, int zal);
1042extern int * allocint (int val);
1043extern int ** allocdint (int xal, int yal);
1044extern int *** alloctint (int xal, int yal, int zal);
1045extern int **** allocqint (int wal, int xal, int yal, int zal);
1046extern float * allocfloat (int val);
1047extern float ** allocdfloat (int xal, int yal);
1048extern float *** alloctfloat (int xal, int yal, int zal);
1049extern double * allocdouble (int val);
1050extern double ** allocddouble (int xal, int yal);
1051extern double *** alloctdouble (int xal, int yal, int zal);
1052extern double **** allocqdouble (int wal, int xal, int yal, int zal);
1053
1054extern GLuint * allocgluint (int val);
1055extern GLuint ** allocdgluint (int xal, int yal);
1056extern GLfloat ** allocdGLfloat (int xal, int yal);
1057
1058extern gchar ** duplicate_strings (int num, gchar ** old_val);
1059extern int * duplicate_int (int num, int * old_val);
1060extern gboolean * duplicate_bool (int num, gboolean * old_val);
1061extern float * duplicate_float (int num, float * old_val);
1062extern double * duplicate_double (int num, double * old_val);
1063extern ColRGBA * duplicate_color (int num, ColRGBA * col);
1064
1065extern void combo_text_append (GtkWidget * combo, gchar * text);
1066extern void combo_text_prepend (GtkWidget * combo, gchar * text);
1067extern GtkWidget * create_combo ();
1068extern GtkTextBuffer * add_buffer (GCallback handler, gpointer data, gchar * text);
1069extern GtkWidget * create_text_view (int dimx, int dimy, int edit, int mono,
1070 GCallback handler, gpointer data, gchar * text);
1071
1072extern GdkPixbuf * convert_to_pixbuf (cairo_surface_t * surf);
1073
1074extern void text_view_set_monospace (GtkWidget * view);
1075extern void gtk_label_align (GtkWidget * lab, float ax, float ay);
1076
1077extern gchar * prepare_for_title (gchar * init);
1078
1079extern void show_the_widgets (GtkWidget * widg);
1080extern gboolean is_the_widget_visible (GtkWidget * widg);
1081extern void widget_set_sensitive (GtkWidget * widg, gboolean sensitive);
1082
1083extern GtkWidget * new_gtk_window ();
1084extern GtkWidget * dialogmodal (gchar * str, GtkWindow * parent);
1085extern GtkWidget * message_dialogmodal (gchar * message, gchar * title, GtkMessageType mtype, GtkButtonsType buttons, GtkWidget * parent);
1086extern GtkWidget * dialog_cancel_apply (gchar * title, GtkWidget * parent, gboolean resiz);
1087extern void run_this_gtk_dialog (GtkWidget * dial, GCallback handler, gpointer data);
1088extern void resize_this_window (GtkWidget * window, int x, int y);
1089
1090extern GtkWidget * create_hscale (float min, float max, float delta,
1091 float val, int pos, int round, int size,
1092 GCallback handler, GCallback scroll_handler, gpointer data);
1093extern GtkWidget * create_vscale (float min, float max, float delta,
1094 float val, int pos, int round, int size,
1095 GCallback handler, GCallback scroll_handler, gpointer data);
1096
1097extern void add_container_child (int type, GtkWidget * widg, GtkWidget * child);
1098extern void add_box_child_end (GtkWidget * widg, GtkWidget * child, gboolean expand, gboolean fill, int padding);
1099extern void add_box_child_start (int orientation, GtkWidget * widg, GtkWidget * child, gboolean expand, gboolean fill, int padding);
1100extern GtkWidget * create_vbox (int spacing);
1101extern GtkWidget * create_hbox (int spacing);
1102extern GtkWidget * dialog_get_content_area (GtkWidget * widg);
1103extern void layout_add_widget (GtkWidget * layout, GtkWidget * child, int x_pos, int y_pos);
1104extern GtkWidget * add_vbox_to_layout (GtkWidget * layout, int size_x, int size_y);
1105extern GtkWidget * create_layout (int x, int y);
1106
1107#ifdef GTK4
1108extern void run_this_gtk_native_dialog (GtkNativeDialog * dial, GCallback handler, gpointer data);
1109extern G_MODULE_EXPORT void select_unselect_this_atom (GSimpleAction * action, GVariant * parameter, gpointer data);
1110extern G_MODULE_EXPORT void select_unselect_atoms (GSimpleAction * action, GVariant * parameter, gpointer data);
1111extern G_MODULE_EXPORT void select_unselect_coord (GSimpleAction * action, GVariant * parameter, gpointer data);
1112
1113extern G_MODULE_EXPORT void label_unlabel_this_atom (GSimpleAction * action, GVariant * parameter, gpointer data);
1114extern G_MODULE_EXPORT void label_unlabel_atoms (GSimpleAction * action, GVariant * parameter, gpointer data);
1115extern G_MODULE_EXPORT void label_unlabel_coord (GSimpleAction * action, GVariant * parameter, gpointer data);
1116
1117extern G_MODULE_EXPORT void show_hide_this_atom (GSimpleAction * action, GVariant * parameter, gpointer data);
1118extern G_MODULE_EXPORT void show_hide_atoms (GSimpleAction * action, GVariant * parameter, gpointer data);
1119extern G_MODULE_EXPORT void show_hide_the_coord (GSimpleAction * action, GVariant * parameter, gpointer data);
1120extern G_MODULE_EXPORT void show_hide_coord (GSimpleAction * action, GVariant * parameter, gpointer data);
1121extern G_MODULE_EXPORT void show_hide_poly (GSimpleAction * action, GVariant * parameter, gpointer data);
1122extern G_MODULE_EXPORT void show_hide_labels (GSimpleAction * action, GVariant * parameter, gpointer data);
1123
1124extern G_MODULE_EXPORT void remove_the_atoms (GSimpleAction * action, GVariant * parameter, gpointer data);
1125extern G_MODULE_EXPORT void replace_the_atoms (GSimpleAction * action, GVariant * parameter, gpointer data);
1126extern G_MODULE_EXPORT void edit_in_new_project (GSimpleAction * action, GVariant * parameter, gpointer data);
1127extern void add_widget_gesture_and_key_action (GtkWidget * widget,
1128 gchar * cp_name, GCallback cp_handler, gpointer cp_data,
1129 gchar * cr_name, GCallback cr_handler, gpointer cr_data,
1130 gchar * kp_name, GCallback kp_handler, gpointer kp_data,
1131 gchar * mo_name, GCallback mo_handler, gpointer mo_data,
1132 gchar * sc_name, GCallback sc_handler, gpointer sc_data);
1133extern G_MODULE_EXPORT gboolean destroy_this_window (GtkWindow * win, gpointer data);
1134extern G_MODULE_EXPORT gboolean hide_this_window (GtkWindow * win, gpointer data);
1135extern GtkFileChooserNative * create_file_chooser (const gchar * title, GtkWindow * parent, GtkFileChooserAction act, const gchar * act_name);
1136extern void pop_menu_at_pointer (GtkWidget * pop, double x, double y);
1137GListModel * file_chooser_get_file_names (GtkFileChooser * chooser);
1138extern void update_menu_bar (glwin * view);
1139
1140#else
1141
1142extern void update_chains_menus (glwin * view);
1143
1144extern G_MODULE_EXPORT void select_unselect_this_atom (GtkWidget * widg, gpointer data);
1145extern G_MODULE_EXPORT void select_unselect_atoms (GtkWidget * widg, gpointer data);
1146extern G_MODULE_EXPORT void select_unselect_coord (GtkWidget * widg, gpointer data);
1147
1148extern G_MODULE_EXPORT void label_unlabel_this_atom (GtkWidget * widg, gpointer data);
1149extern G_MODULE_EXPORT void label_unlabel_atoms (GtkWidget * widg, gpointer data);
1150extern G_MODULE_EXPORT void label_unlabel_coord (GtkWidget * widg, gpointer data);
1151
1152extern G_MODULE_EXPORT void show_hide_this_atom (GtkWidget * widg, gpointer data);
1153extern G_MODULE_EXPORT void show_hide_atoms (GtkWidget * widg, gpointer data);
1154extern G_MODULE_EXPORT void show_hide_the_coord (GtkWidget * widg, gpointer data);
1155extern G_MODULE_EXPORT void show_hide_coord (GtkWidget * widg, gpointer data);
1156extern G_MODULE_EXPORT void show_hide_poly (GtkWidget * widg, gpointer data);
1157extern G_MODULE_EXPORT void show_hide_labels (GtkWidget * widg, gpointer data);
1158
1159extern G_MODULE_EXPORT void remove_the_atoms (GtkWidget * widg, gpointer data);
1160extern G_MODULE_EXPORT void replace_the_atoms (GtkWidget * widg, gpointer data);
1161extern G_MODULE_EXPORT void edit_in_new_project (GtkWidget * widg, gpointer data);
1162extern GtkWidget * create_menu_item (gboolean add_mnemo, gchar * action);
1163extern GtkWidget * create_menu_item_from_widget (GtkWidget * widg, gboolean check, gboolean radio, gboolean status);
1164extern GtkWidget * menu_item_new_with_submenu (gchar * name, gboolean active, GtkWidget * sub_menu);
1165extern void add_menu_separator (GtkWidget * menu);
1166extern G_MODULE_EXPORT gboolean destroy_this_window (GtkWidget * win, GdkEvent * event, gpointer data);
1167extern G_MODULE_EXPORT gboolean hide_this_window (GtkWidget * win, GdkEvent * event, gpointer data);
1168extern GtkWidget * create_file_chooser (const gchar * title, GtkWindow * parent, GtkFileChooserAction act, const gchar * act_name);
1169extern void pop_menu_at_pointer (GtkWidget * widg, GdkEvent * event);
1170GSList * file_chooser_get_file_names (GtkFileChooser * chooser);
1171#endif
1172
1173extern const gchar * entry_get_text (GtkEntry * entry);
1174extern GtkWidget * create_entry (GCallback handler, int dim, int cdim, gboolean key_release, gpointer data);
1175
1176
1177extern GtkWidget * stock_image (const gchar * stock_id);
1178extern void set_image_from_icon_name (GtkWidget * widg, gchar * icon);
1179extern GtkWidget * create_image_from_data (int format, gpointer item_image);
1180
1181extern GtkWidget * gtk3_menu_item (GtkWidget * menu, gchar * name,
1182 int icon_format, gpointer item_icon,
1183 GCallback handler, gpointer data,
1184 gboolean accel, guint key, GdkModifierType mod,
1185 gboolean check, gboolean radio, gboolean status);
1186
1187extern GtkWidget * add_advanced_item (GtkWidget * menu, GCallback handler, gpointer data, gboolean accel, guint key, GdkModifierType mod);
1188
1189extern GtkWidget * markup_label (gchar * text, int dimx, int dimy, float ax, float ay);
1190extern GtkWidget * color_button (ColRGBA col, gboolean alpha, int dimx, int dimy, GCallback handler, gpointer data);
1191extern GtkWidget * font_button (gchar * font, int dimx, int dimy, GCallback handler, gpointer data);
1192extern GtkWidget * spin_button (GCallback handler, double value, double start, double end, double step, int digits, int dim, gpointer data);
1193extern GtkWidget * check_button (gchar * text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data);
1194extern GtkWidget * radio_button (gchar * text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data);
1195extern GtkWidget * create_button (gchar * text, int image_format, gchar * image, int dimx, int dimy, int relief, GCallback handler, gpointer data);
1196
1197extern ColRGBA gdkrgba_to_rgba (GdkRGBA colgdk);
1198extern GdkRGBA colrgba_togtkrgba (ColRGBA col);
1199extern ColRGBA get_button_color (GtkColorChooser * colob);
1200extern ColRGBA get_window_color (GtkWidget * color_win);
1201extern void set_color_chooser_color (GtkWidget * color_win, ColRGBA col);
1202extern void set_renderer_color (int tocol, GtkCellRenderer * renderer, ColRGBA col);
1203
1204extern void button_set_image (GtkButton * but, gchar * text, int format, gpointer image);
1205
1206extern GtkWidget * abox (GtkWidget * box, char * lab, int vspace);
1207extern GtkWidget * bbox (GtkWidget * box, char * lab);
1208extern GtkWidget * cbox (GtkWidget * box, char * lab);
1209extern GtkWidget * fbox (GtkWidget * box, char * lab);
1210extern GtkWidget * create_scroll (GtkWidget * box, int dimx, int dimy, int shadow);
1211extern GtkWidget * create_expander (gchar * name, gchar * file_img);
1212
1213extern GtkWidget * create_win (gchar * str, GtkWidget * parent, gboolean modal, gboolean resiz);
1214
1215extern void widget_add_action (GSimpleActionGroup * action_group, const gchar * act, GCallback handler, gpointer data,
1216 gboolean check, gboolean status, gboolean radio, const gchar * stat);
1217extern void append_menu_item (GMenu * menu, const gchar * label, const gchar * action, const gchar * accel,
1218 const gchar * custom, int format, const gchar * icon,
1219 gboolean check, gboolean status, gboolean radio, const gchar * rstatus);
1220extern void append_submenu (GMenu * menu, const gchar * label, GMenu * submenu);
1221
1222extern GtkWidget * destroy_this_widget (GtkWidget * widg);
1223extern void destroy_this_dialog (GtkDialog * dialog);
1224extern void destroy_this_native_dialog (GtkNativeDialog * dialog);
1225extern G_MODULE_EXPORT void run_destroy_dialog (GtkDialog * dialog, gint response_id, gpointer data);
1226
1227extern void add_gtk_close_event (GtkWidget * widg, GCallback handler, gpointer data);
1228
1229extern gchar * file_chooser_get_file_name (GtkFileChooser * chooser);
1230extern gchar * file_chooser_get_current_folder (GtkFileChooser * chooser);
1231extern gboolean file_chooser_set_file_name (GtkFileChooser * chooser, gchar * filename);
1232extern void file_chooser_set_current_folder (GtkFileChooser * chooser);
1233
1234extern GtkWidget * get_top_level (GtkWidget * widg);
1235
1236extern void provide_gtk_css (gchar * css);
1237extern double get_calc_time (struct timespec start, struct timespec stop);
1238extern gchar * calculation_time (gboolean modelv, double ctime);
1239
1240typedef struct {
1241 GCallback handler;
1242 gpointer data;
1243} focus_data;
1244
1245#endif // GLOBAL_H_
gchar * action_name[5]
Definition atom_edit.c:60
double ay
Definition curve.c:70
double ax
Definition curve.c:70
PangoLayout * layout
Definition curve.c:79
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
Definition labels.c:56
ColRGBA col
Definition d_measures.c:77
gchar * text
Definition datab.c:105
float val
Definition dlp_init.c:117
GtkWidget * dialog_cancel_apply(gchar *title, GtkWidget *parent, gboolean resiz)
create a dialog modal offering a choice to apply something or not
Definition gtk-misc.c:541
int ** allocdint(int xal, int yal)
allocate an int ** pointer
Definition global.c:342
GdkPixbuf * convert_to_pixbuf(cairo_surface_t *surf)
convert cairo surface to GdkPixbuf
Definition gtk-misc.c:1244
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
Definition gtk-misc.c:472
void recreate_all_shaders(glwin *view)
re-initialize all OpenGL shaders
workspace workzone
Definition project.c:46
ImageFormats
Definition global.h:231
@ IMG_PIXBUF
Definition global.h:233
@ IMG_NONE
Definition global.h:232
@ IMG_STOCK
Definition global.h:236
@ IMG_SURFACE
Definition global.h:234
@ IMG_FILE
Definition global.h:235
void file_chooser_set_current_folder(GtkFileChooser *chooser)
set current folder in a GtkFilechooser
Definition gtk-misc.c:2164
gboolean reading_input
Definition global.c:182
double **** allocqdouble(int wal, int xal, int yal, int zal)
allocate a double **** pointer
Definition global.c:534
gchar * ATOMES_CONFIG
Definition global.c:135
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
Definition gtk-misc.c:1294
char * untime[6]
Definition global.c:149
float ** allocdfloat(int xal, int yal)
allocate a float ** pointer
Definition global.c:426
glwin * active_glwin
Definition project.c:53
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
Definition gtk-misc.c:613
void set_renderer_color(int tocol, GtkCellRenderer *renderer, ColRGBA col)
set the color of a GtkCellRenderer
Definition gtk-misc.c:1633
G_MODULE_EXPORT void show_hide_labels(GtkWidget *widg, gpointer data)
GLfloat ** allocdGLfloat(int xal, int yal)
allocate a GLfloat ** pointer
Definition glview.c:161
GtkWidget * create_menu_item_from_widget(GtkWidget *widg, gboolean check, gboolean radio, gboolean status)
ColRGBA gdkrgba_to_rgba(GdkRGBA colgdk)
convert GdkRGBA color to ColRGBA color
Definition gtk-misc.c:1597
GLuint ** allocdgluint(int xal, int yal)
allocate a GLuint ** pointer
Definition glview.c:139
GtkStatusbar * statusbar
Definition global.c:226
GtkWidget * register_button
Definition global.c:223
G_MODULE_EXPORT void show_hide_poly(GtkWidget *widg, gpointer data)
show / hide polyhedra callback - GTK3
Definition m_poly.c:79
int mol_update
Definition global.c:171
gchar * workspacefile
Definition global.c:156
double * duplicate_double(int num, double *old_val)
copy a list of double
Definition global.c:620
int * duplicate_int(int num, int *old_val)
copy a list of int
Definition global.c:572
int *** alloctint(int xal, int yal, int zal)
allocate an int *** pointer
Definition global.c:365
GtkWidget * font_button(gchar *font, int dimx, int dimy, GCallback handler, gpointer data)
create a font selection button
Definition gtk-misc.c:1730
char * ifbug
Definition global.c:141
void update_chains_menus(glwin *view)
GtkWidget * create_text_view(int dimx, int dimy, int edit, int mono, GCallback handler, gpointer data, gchar *text)
create a GtkTextView and display some text
Definition gtk-misc.c:1179
gchar * edition_action_names[3]
Definition global.c:197
gchar * analyze_action_names[9]
Definition global.c:201
GtkTextBuffer * add_buffer(GCallback handler, gpointer data, gchar *text)
create a GtkTextBuffer
Definition gtk-misc.c:1151
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
Definition gtk-misc.c:1940
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
Definition gtk-misc.c:490
void set_color_chooser_color(GtkWidget *color_win, ColRGBA col)
set the color of a color selection window
Definition gtk-misc.c:2241
coord_info * active_coord
Definition project.c:49
tint cut_lab
Definition gui.c:130
gboolean is_the_widget_visible(GtkWidget *widg)
test if a GtkWidget exist, then return if it is visible or not
Definition gtk-misc.c:694
GtkWidget * gtk3_menu_item(GtkWidget *menu, gchar *name, int icon_format, gpointer item_icon, GCallback handler, gpointer data, gboolean accel, guint key, GdkModifierType mod, gboolean check, gboolean radio, gboolean status)
gboolean is_atom_win_active(glwin *view)
is the model edition window visible ?
Definition atom_edit.c:71
double pi
Definition global.c:195
void resize_this_window(GtkWidget *window, int x, int y)
resize this GtkWindow
Definition gtk-misc.c:561
gboolean newspace
Definition global.c:181
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
Definition gtk-misc.c:425
cell_info * active_cell
Definition project.c:50
element_data periodic_table_info[]
Definition w_library.c:71
int dialog_id
Definition global.c:167
char * rings_type[5]
Definition global.c:143
ColRGBA get_window_color(GtkWidget *color_win)
get the ColRGBA color from a color selection window
Definition gtk-misc.c:2226
project * proj
GtkTextTag * tag
Definition global.c:225
void remove_edition_actions()
remove all edition actions
Definition gui.c:306
GtkWidget * add_vbox_to_layout(GtkWidget *layout, int size_x, int size_y)
Insert a vertical GtkBox in a GtkLatout then send back the GtkBox.
Definition gtk-misc.c:844
gchar * file_chooser_get_file_name(GtkFileChooser *chooser)
get a file name from a GtkFileChooser (single file selected)
Definition gtk-misc.c:2112
GtkWidget * MainScrol[2]
Definition global.c:220
G_MODULE_EXPORT void show_hide_coord(GtkWidget *widg, gpointer data)
show/hide coordination callback GTK3
Definition m_coord.c:106
struct timespec start_time
Definition global.c:191
int activep
Definition global.c:159
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
Definition gtk-misc.c:577
chemical_data * active_chem
Definition project.c:48
GdkRGBA colrgba_togtkrgba(ColRGBA col)
convert ColRGBA color to GdkRGBA color
Definition gtk-misc.c:1614
void clean_rings_data(int rid, glwin *view)
clean a ring type data for a glview
Definition ringscall.c:374
GSimpleAction * edition_actions[3]
Definition global.c:210
int * pasted_todo
Definition global.c:174
void opengl_project_changed(int id)
change the OpenGL project
Definition update_p.c:245
int inactep
Definition global.c:162
gboolean in_movie_encoding
Definition global.c:180
gboolean * allocbool(int val)
allocate a gboolean * pointer
Definition global.c:266
double * xsk
Definition global.c:176
void update_entry_int(GtkEntry *entry, int intval)
update the content of a GtkEntry as int
Definition gtk-misc.c:594
G_MODULE_EXPORT gboolean hide_this_window(GtkWidget *win, GdkEvent *event, gpointer data)
hide a GtkWindow
Definition gtk-misc.c:2347
gchar * graph_img[NGRAPHS]
Definition gui.c:105
void pop_menu_at_pointer(GtkWidget *widg, GdkEvent *event)
popup a menu at pointer location
Definition gtk-misc.c:2277
int activef
Definition global.c:161
gboolean file_chooser_set_file_name(GtkFileChooser *chooser, gchar *filename)
set file name in a GtkFilechooser
Definition gtk-misc.c:2145
void widget_add_action(GSimpleActionGroup *action_group, const gchar *act, GCallback handler, gpointer data, gboolean check, gboolean status, gboolean radio, const gchar *stat)
add an action to an action group
Definition gui.c:515
G_MODULE_EXPORT gboolean destroy_this_window(GtkWidget *win, GdkEvent *event, gpointer data)
destroy a GtkWindow
Definition gtk-misc.c:2320
G_MODULE_EXPORT void select_unselect_this_atom(GtkWidget *widg, gpointer data)
select / unselect this atom callback GTK3
Definition popup.c:1176
gboolean tmp_adv_bonding[2]
Definition global.c:183
GtkWidget * stock_image(const gchar *stock_id)
create a GtkImage for the Gtk database
Definition gtk-misc.c:1344
void append_submenu(GMenu *menu, const gchar *label, GMenu *submenu)
append a GMenuItem with a subenu to a GMenu, and use markup for the GMenuItem
Definition gui.c:602
GdkPixbuf * OGLC
Definition global.c:235
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
Definition gtk-misc.c:2363
GtkWidget * create_vscale(float min, float max, float delta, float val, int pos, int round, int size, GCallback handler, GCallback scroll_handler, gpointer data)
create an vertical scale GtkWidget
Definition gtk-misc.c:758
void layout_add_widget(GtkWidget *layout, GtkWidget *child, int x_pos, int y_pos)
Add a GtkWidget in a GtkLayout.
Definition gtk-misc.c:826
GtkWidget * fbox(GtkWidget *box, char *lab)
Definition gtk-misc.c:1921
#define NGRAPHS
GMainLoop * Event_loop[5]
Definition global.c:178
gchar * file_chooser_get_current_folder(GtkFileChooser *chooser)
get the current folder for a GtkFileChooser
Definition gtk-misc.c:2128
gboolean silent_input
Definition global.c:188
ColRGBA std[6]
Definition gui.c:132
double ** allocddouble(int xal, int yal)
allocate a double ** pointer
Definition global.c:487
GtkWidget * radio_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a radio button
Definition gtk-misc.c:1814
GtkWidget * spin_button(GCallback handler, double value, double start, double end, double step, int digits, int dim, gpointer data)
create a spin button
Definition gtk-misc.c:1752
int activew
Definition global.c:163
GtkApplication * AtomesApp
Definition global.c:213
#define NITEMS
Definition global.h:292
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
Definition gtk-misc.c:1779
G_MODULE_EXPORT void on_calc_bonds_released(GtkWidget *widg, gpointer data)
compute bonding properties
Definition bdcall.c:471
GtkWidget * add_advanced_item(GtkWidget *menu, GCallback handler, gpointer data, gboolean accel, guint key, GdkModifierType mod)
int nprojects
Definition global.c:158
box_info * active_box
Definition project.c:51
GtkWidget * MainFrame[2]
Definition global.c:216
ContainerType
Definition global.h:221
@ CONTAINER_EXP
Definition global.h:227
@ CONTAINER_WIN
Definition global.h:222
@ CONTAINER_FRA
Definition global.h:226
@ CONTAINER_BUT
Definition global.h:225
@ CONTAINER_SCR
Definition global.h:223
@ CONTAINER_VIE
Definition global.h:224
int activev
Definition global.c:160
gboolean selected_status
Definition global.c:187
G_MODULE_EXPORT void label_unlabel_coord(GtkWidget *widg, gpointer data)
label / unlabel a type of coordination callback GTK3
Definition popup.c:1840
int frag_update
Definition global.c:170
double * allocdouble(int val)
allocate a double * pointer
Definition global.c:471
GtkWidget * MainWindow
Definition global.c:214
gchar * calculation_time(gboolean modelv, double ctime)
get calculation time, human readable
Definition global.c:649
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
Definition gtk-misc.c:1843
GdkPixbuf * OGLM
Definition global.c:234
G_MODULE_EXPORT void show_hide_this_atom(GtkWidget *widg, gpointer data)
show / hide this atom callback GTK3
Definition popup.c:1018
G_MODULE_EXPORT void label_unlabel_atoms(GtkWidget *widg, gpointer data)
label / unlabel a type of atom(s) callback GTK3
Definition popup.c:1502
GtkWidget * get_top_level(GtkWidget *widg)
get the top level container, window, of a widget
Definition gtk-misc.c:2291
#define NCFORMATS
Definition global.h:290
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
Definition gtk-misc.c:903
void remove_edition_and_analyze_actions()
remove all edition and analysis action
Definition gui.c:317
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
Definition gtk-misc.c:805
void button_set_image(GtkButton *but, gchar *text, int format, gpointer image)
Add an image to a GtkButton.
Definition gtk-misc.c:1657
gboolean column_label
Definition global.c:184
gchar * projfile
Definition global.c:140
gchar ** duplicate_strings(int num, gchar **old_val)
copy a list of strings
Definition global.c:556
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
Definition gtk-misc.c:1565
gchar * ATOMES_URL
Definition global.c:136
GtkWidget * cbox(GtkWidget *box, char *lab)
Definition gtk-misc.c:1911
void clean_chains_data(glwin *view)
cleaning the OpenGL data related to chain statistics
Definition chainscall.c:258
project * opengl_project
Definition project.c:54
float * duplicate_float(int num, float *old_val)
copy a list of float
Definition global.c:604
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.
Definition gtk-misc.c:279
int bonds_update
Definition global.c:169
ColRGBA get_button_color(GtkColorChooser *colob)
get the ColRGBA color from a GtkColorChooser button
Definition gtk-misc.c:2212
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:186
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
Definition gtk-misc.c:2041
void text_view_set_monospace(GtkWidget *view)
set the font of a GtkTextView as monospace
Definition gtk-misc.c:667
void add_action(GSimpleAction *action)
add action to the main window action map
Definition gui.c:284
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:793
gboolean * duplicate_bool(int num, gboolean *old_val)
copy a list of gboolean
Definition global.c:588
GtkWidget * new_gtk_window()
create a new GtkWindow
Definition gtk-misc.c:328
GtkWidget * create_image_from_data(int format, gpointer item_image)
create Gtk image for data
Definition gtk-misc.c:1423
GdkPixbuf * SETTINGS
Definition global.c:232
gboolean check_label
Definition global.c:185
double *** alloctdouble(int xal, int yal, int zal)
allocate a double *** pointer
Definition global.c:510
double opac
Definition global.c:194
int * allocint(int val)
allocate an int * pointer
Definition global.c:326
void gtk_label_align(GtkWidget *lab, float ax, float ay)
set text alignment in a GtkLabel
Definition gtk-misc.c:681
gchar * mode_name[2]
Definition global.c:137
char * coord_files_ext[NCFORMATS+1]
Definition callbacks.c:100
G_MODULE_EXPORT void select_unselect_atoms(GtkWidget *widg, gpointer data)
select / unselect a type of atom(s) callback GTK3
Definition popup.c:1550
GdkPixbuf * THEBD
Definition global.c:230
gboolean object_motion
Definition global.c:186
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
Definition gtk-misc.c:880
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
Definition gtk-misc.c:2078
GtkWidget * create_layout(int x, int y)
create a GtkLayout / GtkFixed widget
Definition gtk-misc.c:860
GtkWidget * create_menu_item(gboolean add_mnemo, gchar *action)
GdkPixbuf * OGL
Definition global.c:233
gboolean *** alloctbool(int xal, int yal, int zal)
allocate a gboolean *** pointer
Definition global.c:305
GdkPixbuf * RUN
Definition global.c:236
GdkPixbuf * THETD
Definition global.c:228
gboolean ** allocdbool(int xal, int yal)
allocate a gboolean ** pointer
Definition global.c:282
GtkWidget * atomes_logo
Definition global.c:221
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2010
GtkWidget * progressbar
Definition global.c:219
GLuint * allocgluint(int val)
allocate a GLuint * pointer
Definition glview.c:123
GtkWidget * color_button(ColRGBA col, gboolean alpha, int dimx, int dimy, GCallback handler, gpointer data)
create a color selection button
Definition gtk-misc.c:1708
G_MODULE_EXPORT void select_unselect_coord(GtkWidget *widg, gpointer data)
select / unselect a type of coordination callback GTK3
Definition popup.c:1916
GtkWidget * create_hscale(float min, float max, float delta, float val, int pos, int round, int size, GCallback handler, GCallback scroll_handler, gpointer data)
create an horizontal scale GtkWidget
Definition gtk-misc.c:724
GtkWidget * bbox(GtkWidget *box, char *lab)
Definition gtk-misc.c:1901
void add_box_child_end(GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the end position.
Definition gtk-misc.c:257
void update_entry_text(GtkEntry *entry, gchar *text)
update the content of a GtkEntry as string
Definition gtk-misc.c:651
void provide_gtk_css(gchar *css)
create a css provider based on the css data
Definition gtk-misc.c:1986
double get_calc_time(struct timespec start, struct timespec stop)
get calculation time in s
Definition global.c:636
#define min(a, b)
Definition global.h:75
tint cut_sel
Definition gui.c:129
GdkPixbuf * SETTING
Definition global.c:231
char * graph_name[NGRAPHS]
Definition gui.c:118
int atomes_visual
Definition global.c:165
int **** allocqint(int wal, int xal, int yal, int zal)
allocate an int **** pointer
Definition global.c:389
float * allocfloat(int val)
allocate a float * pointer
Definition global.c:410
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
Definition tools.c:71
void clean_volumes_data(glwin *view)
clean volume data
Definition w_volumes.c:83
G_MODULE_EXPORT void show_hide_the_coord(GtkWidget *widg, gpointer data)
show / hide a type of coordination callback GTK3
Definition popup.c:1787
struct timespec stop_time
Definition global.c:192
void cutoffsend()
send cutoffs to Fortran90
Definition bdcall.c:243
gboolean in_md_shaders(project *this_proj, int id)
is this shader MD dependent ?
gchar * bravais_img[14]
Definition global.c:138
G_MODULE_EXPORT void show_hide_atoms(GtkWidget *widg, gpointer data)
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
Definition gtk-misc.c:206
void set_image_from_icon_name(GtkWidget *widg, gchar *icon)
set a image from a stock icon name
Definition gtk-misc.c:1874
#define MAXDATC
Number of tabs for the description of the classical calculation.
Definition global.h:657
char * coord_files[NCFORMATS+1]
Definition callbacks.c:86
int statusval
Definition global.c:164
GtkWidget * message_dialogmodal(gchar *message, gchar *title, GtkMessageType mtype, GtkButtonsType buttons, GtkWidget *parent)
create a modal (cannot be ignored) message window
Definition gtk-misc.c:511
gboolean cif_use_symmetry_positions
Definition global.c:189
GSimpleAction * analyze_actions[9]
Definition global.c:211
void combo_text_prepend(GtkWidget *combo, gchar *text)
prepend text in GtkComboBox widget
Definition gtk-misc.c:893
void append_menu_item(GMenu *menu, const gchar *label, const gchar *action, const gchar *accel, const gchar *custom, int format, const gchar *icon, gboolean check, gboolean status, gboolean radio, const gchar *rstatus)
create a menu item, then append it to a menu
Definition gui.c:632
G_MODULE_EXPORT void replace_the_atoms(GtkWidget *widg, gpointer data)
replace selected atom(s) callback GTK3
Definition popup.c:1325
GtkWidget * curvetoolbox
Definition global.c:218
void add_menu_separator(GtkWidget *menu)
GdkPixbuf * THEMO
Definition global.c:229
GtkWidget * menu_item_new_with_submenu(gchar *name, gboolean active, GtkWidget *sub_menu)
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Definition gtk-misc.c:781
ColRGBA * duplicate_color(int num, ColRGBA *col)
duplicate a ColRGBA pointer
Definition gtk-misc.c:1582
GtkWidget * abox(GtkWidget *box, char *lab, int vspace)
box creating routine, to help design faster elements for the GUI
Definition gtk-misc.c:1892
GtkWidget * pop
Definition global.c:217
G_MODULE_EXPORT void edit_in_new_project(GtkWidget *widg, gpointer data)
create new project using selection callback GTK3
Definition popup.c:2193
GtkWidget * create_expander(gchar *name, gchar *file_img)
create GtkExpander
Definition gtk-misc.c:1964
gchar * ifield[8]
Definition global.c:139
GtkWidget * create_file_chooser(const gchar *title, GtkWindow *parent, GtkFileChooserAction act, const gchar *act_name)
create a GtkFileChooser, utility to select file(s)
Definition gtk-misc.c:2199
#define MAXDATA
Number of tabs for the description of the classical force field.
Definition global.h:662
float *** alloctfloat(int xal, int yal, int zal)
allocate a float *** pointer
Definition global.c:449
GSList * file_chooser_get_file_names(GtkFileChooser *chooser)
create a file list from files selected using a GtkFileChooser
Definition gtk-misc.c:2099
project * active_project
Definition project.c:47
G_MODULE_EXPORT void label_unlabel_this_atom(GtkWidget *widg, gpointer data)
label / unlabel this atom callback GTK3
Definition popup.c:1127
gchar * dots[NDOTS]
Definition gui.c:103
GtkWidget * calc_dialog
Definition global.c:222
void initcutoffs(chemical_data *chem, int species)
initialize bond cutoffs
Definition bdcall.c:207
void update_rings_menus(glwin *view)
#define NCALCS
int tmp_pixels[2]
Definition global.c:173
void destroy_this_native_dialog(GtkNativeDialog *dialog)
destroy a GtkNativeDialog
Definition gtk-misc.c:2060
atomic_object * copied_object
Definition glwindow.c:121
void remove_action(gchar *action_name)
add action from the main window action map
Definition gui.c:296
char * calc_name[NCALCS-2]
Definition gui.c:107
image * active_image
Definition project.c:52
#define NDOTS
GtkWidget * MainView
Definition global.c:215
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:169
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
void update_entry_long_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as long double
Definition gtk-misc.c:632
#define max(a, b)
Definition global.h:74
G_MODULE_EXPORT void remove_the_atoms(GtkWidget *widg, gpointer data)
remove selected atom(s) callback GTK3
Definition popup.c:1296
action
Definition glview.h:189
int step
Definition ogl_draw.c:70
Variable declarations related the OpenGL window Data structure declarations related the OpenGL wind...
Functions for OpenGL math.
double y
Definition ogl_draw.c:57
double x
Definition ogl_draw.c:57
float blue
Definition global.h:118
float alpha
Definition global.h:119
float red
Definition global.h:116
float green
Definition global.h:117
CurveExtra * prev
Definition global.h:553
tint id
Definition global.h:551
CurveExtra * next
Definition global.h:554
DataLayout * layout
Definition global.h:552
GtkWidget * plot
Definition global.h:580
ColRGBA backcolor
Definition global.h:589
int wsize[2]
Definition global.h:586
CurveState state
Definition global.h:650
double cmax[2]
Definition global.h:579
double axmax[2]
Definition global.h:594
GtkWidget * datatree
Definition global.h:587
ExtraSets * extrac
Definition global.h:641
GtkWidget * curve_hbox
Definition global.h:583
int legend_box_dash
Definition global.h:622
ColRGBA title_color
Definition global.h:631
char * axis_title[2]
Definition global.h:596
int labels_shift_y[2]
Definition global.h:615
gboolean show_legend
Definition global.h:617
gboolean default_title
Definition global.h:628
int format
Definition global.h:590
gboolean autoscale[2]
Definition global.h:601
double legend_pos[2]
Definition global.h:618
double cmin[2]
Definition global.h:578
GtkWidget * window
Definition global.h:584
double majt[2]
Definition global.h:604
gboolean show_legend_box
Definition global.h:621
ColRGBA frame_color
Definition global.h:637
int axis_title_y[2]
Definition global.h:598
gboolean show_frame
Definition global.h:633
double axmin[2]
Definition global.h:593
int labels_digit[2]
Definition global.h:611
int labels_shift_x[2]
Definition global.h:614
ColRGBA legend_box_color
Definition global.h:623
int frame_type
Definition global.h:634
int bshift
Definition global.h:644
int ticks_pos[2]
Definition global.h:607
GtkWidget * curve_vbox
Definition global.h:582
char * name
Definition global.h:591
double * err
Definition global.h:577
int majt_size[2]
Definition global.h:608
ColRGBA legend_color
Definition global.h:620
gboolean axis_defaut_title[2]
Definition global.h:595
int axis_title_x[2]
Definition global.h:597
int scale[2]
Definition global.h:600
cairo_surface_t * surface
Definition global.h:642
int ticks_io[2]
Definition global.h:606
gchar * axis_title_font[2]
Definition global.h:599
int ndata
Definition global.h:575
gchar * path
Definition global.h:648
int labels_pos[2]
Definition global.h:610
double * data[2]
Definition global.h:576
double frame_thickness
Definition global.h:636
GtkWidget * pos
Definition global.h:585
gboolean displayed
Definition global.h:646
double title_pos[2]
Definition global.h:629
int mint_size[2]
Definition global.h:609
qint idcol[2]
Definition global.h:588
int action_id
Definition global.h:649
gboolean show_title
Definition global.h:627
char * cfile
Definition global.h:647
int cid
Definition global.h:574
double legend_box_thickness
Definition global.h:624
gchar * legend_font
Definition global.h:619
DataLayout * layout
Definition global.h:640
double labels_angle[2]
Definition global.h:613
int draw_id
Definition global.h:643
gboolean show_grid[2]
Definition global.h:602
GSimpleActionGroup * action_group
Definition global.h:651
gchar * labels_font[2]
Definition global.h:612
gchar * title_font
Definition global.h:630
int frame_dash
Definition global.h:635
char * title
Definition global.h:626
int mint[2]
Definition global.h:605
GtkWidget * button
Definition global.h:581
double frame_pos[2][2]
Definition global.h:638
gboolean show_axis[2]
Definition global.h:603
tint * id
Definition global.h:524
MouseState mouseState
Definition global.h:523
double thickness
Definition global.h:534
int gfreq
Definition global.h:538
double hopac
Definition global.h:541
int glyph
Definition global.h:536
double hwidth
Definition global.h:540
int aspect
Definition global.h:539
ColRGBA datacolor
Definition global.h:533
int dash
Definition global.h:535
int hpos
Definition global.h:542
double gsize
Definition global.h:537
CurveExtra * last
Definition global.h:565
CurveExtra * first
Definition global.h:564
int extras
Definition global.h:563
gboolean MouseIsDown
Definition global.h:514
gint start_y
Definition global.h:512
gint start_x
Definition global.h:511
gint time
Definition global.h:513
Definition global.h:839
int sp
Definition global.h:841
gboolean label[2]
Definition global.h:876
int numv
Definition global.h:846
int coord[5]
Definition global.h:853
int id
Definition global.h:840
gboolean cloned
Definition global.h:878
int faid
Definition global.h:874
int * vois
Definition global.h:847
int style
Definition global.h:879
gboolean pick[2]
Definition global.h:877
int ** chain
Definition global.h:872
double z
Definition global.h:845
gboolean show[2]
Definition global.h:875
double y
Definition global.h:844
int ** rings[5]
Definition global.h:865
int fid
Definition global.h:873
atom * prev
Definition global.h:880
atom * next
Definition global.h:881
double x
Definition global.h:843
char ** label
Definition global.h:816
int * nsps
Definition global.h:814
int * formula
Definition global.h:815
double ** cutoffs
Definition global.h:818
double grtotcutoff
Definition global.h:819
double ** chem_prop
Definition global.h:808
char ** element
Definition global.h:817
double * io_opts
Definition global.h:684
struct field_external * first_external
Definition global.h:680
struct field_molecule * first_molecule
Definition global.h:674
struct field_nth_body * first_body[5]
Definition global.h:676
double * sys_opts
Definition global.h:683
double * equi_opts
Definition global.h:689
int extern_fields
Definition global.h:679
double * elec_opts
Definition global.h:686
gboolean afp[MAXDATC+MAXDATA]
Definition global.h:669
double * md_opts
Definition global.h:693
int nbody[5]
Definition global.h:675
gboolean prepare_file[2]
Definition global.h:667
double * out_opts
Definition global.h:694
double * vdw_opts
Definition global.h:687
double * ana_opts
Definition global.h:685
double *** cross
Definition global.h:678
double * thermo_opts
Definition global.h:692
double * met_opts
Definition global.h:688
int * nsps
Definition global.h:479
int natomes
Definition global.h:475
double ** coord
Definition global.h:480
int ndummy
Definition global.h:483
int atom_unlabelled
Definition global.h:499
int * object_list
Definition global.h:502
int object_to_insert
Definition global.h:501
cell_info lattice
Definition global.h:485
int ** occupied
Definition global.h:497
gchar *** sym_pos
Definition global.h:493
gboolean cartesian
Definition global.h:481
gchar * info
Definition global.h:487
int mid
Definition global.h:486
gchar ** label
Definition global.h:488
int setting
Definition global.h:494
int * wyckoff
Definition global.h:495
int * u_atom_list
Definition global.h:500
int num_sym_pos
Definition global.h:492
gchar ** dummy
Definition global.h:484
int steps
Definition global.h:476
double * z
Definition global.h:478
double * occupancy
Definition global.h:496
int * multi
Definition global.h:498
int traj
Definition global.h:490
int * lot
Definition global.h:482
int nspec
Definition global.h:477
int cmin
Definition global.h:145
int * ntg[10]
Definition global.h:142
int cmax
Definition global.h:146
int ** geolist[10]
Definition global.h:143
int *** partial_geo
Definition global.h:144
int totcoord[10]
Definition global.h:135
int species
Definition global.h:128
Definition global.h:754
gchar * files[5]
Definition global.h:763
int input_type
Definition global.h:755
gchar * info
Definition global.h:766
int thermostats
Definition global.h:758
int fixat[2]
Definition global.h:760
thermostat * ions_thermostat
Definition global.h:759
double extra_opts[3][4]
Definition global.h:757
int ** spec_data
Definition global.h:765
gchar *** spec_files
Definition global.h:764
double opts[42]
Definition global.h:756
int ** fixcoord[2]
Definition global.h:762
int * fixlist[2]
Definition global.h:761
Definition global.h:735
dummy_atom * dummy
Definition global.h:745
gchar * info
Definition global.h:749
int thermostats
Definition global.h:738
int * fixlist
Definition global.h:742
thermostat * ions_thermostat
Definition global.h:739
int calc_type
Definition global.h:736
int dummies
Definition global.h:744
int fixat
Definition global.h:741
int restart[10]
Definition global.h:737
double default_opts[17]
Definition global.h:746
int ** pp
Definition global.h:748
int ** fixcoord
Definition global.h:743
double calc_opts[24]
Definition global.h:747
thermostat * elec_thermostat
Definition global.h:740
Definition global.h:91
int b
Definition global.h:93
int a
Definition global.h:92
int numv
Definition global.h:727
dummy_atom * prev
Definition global.h:730
int natoms
Definition global.h:725
int pick[2]
Definition global.h:721
int * vois
Definition global.h:728
gboolean show
Definition global.h:722
int * list
Definition global.h:726
dummy_atom * next
Definition global.h:729
int type
Definition global.h:720
int coord[4]
Definition global.h:724
double xyz[3]
Definition global.h:723
float M
Definition global.h:801
gchar * lab
Definition global.h:798
gchar * name
Definition global.h:799
gpointer data
Definition global.h:1242
GCallback handler
Definition global.h:1241
Definition glwin.h:875
Definition glwin.h:277
gchar * type
Definition global.h:828
gchar * object
Definition global.h:829
gchar * line
Definition global.h:464
struct line_node * next
Definition global.h:465
struct line_node * prev
Definition global.h:466
int * mol_by_step
Definition global.h:788
molecule ** mols
Definition global.h:789
int * fragments
Definition global.h:776
int natoms
Definition global.h:777
int md
Definition global.h:774
int id
Definition global.h:773
int multiplicity
Definition global.h:775
int * species
Definition global.h:779
int nspec
Definition global.h:778
int natomes
Definition global.h:903
double fact[4]
Definition global.h:956
int tunit
Definition global.h:906
gboolean run
Definition global.h:899
gboolean visok[NGRAPHS]
Definition global.h:916
double delta[NGRAPHS]
Definition global.h:923
model * modelfc
Definition global.h:971
gboolean initgl
Definition global.h:965
int numc[NGRAPHS]
Definition global.h:920
double max[NGRAPHS]
Definition global.h:925
int xcor
Definition global.h:917
tint * idcc[NGRAPHS]
Definition global.h:959
gboolean runok[NGRAPHS]
Definition global.h:914
int rsparam[5][6]
Definition global.h:930
char * projfile
Definition global.h:895
gboolean newproj
Definition global.h:898
coord_info * coord
Definition global.h:908
char * name
Definition global.h:894
double calc_time[NGRAPHS]
Definition global.h:922
gboolean runc[3]
Definition global.h:918
double rsdata[5][5]
Definition global.h:937
int id
Definition global.h:893
double sk_advanced[2]
Definition global.h:957
int num_delta[NGRAPHS]
Definition global.h:921
int csearch
Definition global.h:943
project * next
Definition global.h:985
int tfile
Definition global.h:901
gboolean dmtx
Definition global.h:900
int dummies
Definition global.h:904
Curve ** curves[NGRAPHS]
Definition global.h:961
int steps
Definition global.h:905
atom ** atoms
Definition global.h:910
char * bondfile
Definition global.h:897
gboolean initok[NGRAPHS]
Definition global.h:915
cp2k * cp2k_input[2]
Definition global.h:975
project * prev
Definition global.h:986
char * coordfile
Definition global.h:896
double csdata[2]
Definition global.h:953
cell_info cell
Definition global.h:909
int csparam[7]
Definition global.h:945
int numwid
Definition global.h:960
GtkTextBuffer * text_buffer[NITEMS]
Definition global.h:958
cpmd * cpmd_input[2]
Definition global.h:974
classical_field * force_field[2]
Definition global.h:973
double min[NGRAPHS]
Definition global.h:924
int tmp_pixels[2]
Definition global.h:966
int nspec
Definition global.h:902
chemical_data * chemistry
Definition global.h:907
int rsearch[2]
Definition global.h:927
glwin * modelgl
Definition global.h:967
Definition global.h:106
int b
Definition global.h:108
int c
Definition global.h:109
int d
Definition global.h:110
int a
Definition global.h:107
int natoms
Definition global.h:709
thermostat * next
Definition global.h:711
thermostat * prev
Definition global.h:712
gboolean show
Definition global.h:707
int * list
Definition global.h:710
int type
Definition global.h:703
double params[4]
Definition global.h:708
int sys
Definition global.h:706
Definition global.h:98
int b
Definition global.h:100
int c
Definition global.h:101
int a
Definition global.h:99
project * last
Definition global.h:993
project * first
Definition global.h:992
int status
Definition w_advance.c:160
GdkPixbuf * pix
Definition workspace.c:69
GtkWidget * lab
Definition workspace.c:73