84#define APP_EXTENSION ".exe"
104gchar *
bs_styles[] = {
"ball&stick",
"balls&sticks",
"balls&stick",
"ball&sticks",
105 "ball_&_stick",
"balls_&_sticks",
"balls_&_stick",
"ball_&_sticks",
106 "ball_and_sticks",
"balls_and_sticks",
"balls_and_stick",
"ball_and_stick",
107 "ballsandsticks",
"ballsandstick",
"ballanddsticks",
"ballandstick",
108 "b&s",
"b_and_s",
"bs",
"b", NULL};
109gchar *
wi_styles[] = {
"wireframe",
"wireframes",
"wires",
"wire",
"wi",
"w", NULL};
110gchar *
co_styles[] = {
"covalent_radius",
"covalent",
"cov_rad",
"cov",
"co",
"cr", NULL};
111gchar *
io_styles[] = {
"ionic_radius",
"ionic_rad",
"ionic",
"ion",
"ir", NULL};
112gchar *
vw_styles[] = {
"vdw_radius",
"van_der_waals_radius",
"van_der_waals",
"vdw_radius",
"vdw_rad",
"vdw",
"vr", NULL};
113gchar *
cr_styles[] = {
"crystal",
"crystal_radius",
"in_crystal",
"in_crystal_radius",
"cryst",
"crystal_rad",
"cr", NULL};
114gchar *
sp_styles[] = {
"sphere",
"spheres",
"sph",
"sp",
"S", NULL};
115gchar *
cy_styles[] = {
"cylinder",
"cylinders",
"cyl",
"cy",
"c", NULL};
125 printf (_(
"\nUsage: atomes [OPTION]\n"
127 " atomes [OPTION] [FILE]\n"
128 " atomes [FILE1] [FILE2] ...\n"
129 " atomes [OPTION1] [FILE1] [OPTION2] [FILE2] ...\n\n"
130 "3D atomic-scale models analysis, creation/edition and post-processing tool\n\n"
132 " -v, --version version information\n"
133 " -h, --help display this help message\n\n"
134 "files, any number, in any order, in the following formats:\n\n"
135 " atomes workspace file : .awf\n"
136 " atomes project file : .apf\n"
137 " XYZ coordinates file : .xyz\n"
138 " Chem3D coordinates file : .c3d\n"
139 " CPMD trajectory : .trj\n"
140 " VASP trajectory : .xdatcar\n"
141 " PDB coordinates : .pdb, .ent\n"
142 " Crystallographic Information File : .cif\n"
143 " DL-POLY history file : .hist\n"
144 " ISAACS project file : .ipf\n\n"
145 " alternatively specify the file format using:\n\n"
152 " -pdb [FILE], or, -ent [FILE]\n"
157 " atomes -pdb this.f file.awf -cif that.f *.xyz\n\n"
158 "Image rendering from the command line:\n\n"
159 "Usage: atomes [IMAGE_OPTIONS]\n"
160 " -p, --png, --render-png render image in PNG format\n"
161 " -j, --jpg, --render-jpg render image in JPEG format\n"
162 " -o, --output=[FILE] image file name\n"
163 " -W, --width=[XSIZE] image width\n"
164 " -H, --height=[YSIZE] image height\n"
165 " -s, --style=[STYLE] rendering style\n"
166 " -r, --rep=[REP] representation type\n"
167 " -b, --box=[STYLE] box style\n"
168 " -a, --axis=[STYLE] axis style\n"
169 " -e, --acolor=[MAP] atoms and bonds color map\n"
170 " -t, --pcolor=[MAP] ployhedra color map\n"
171 " -C, --box_color=[COLOR] box color\n"
172 " -G, --back_grad=[GRAD] background gradient type\n"
173 " -B, --back_color=[COLOR] background color\n"
174 " -D, --back_dir=[DIR] background gradient direction\n"
175 " -P, --back_pos=[POS] colors mixed position\n"
176 " -U, --grad_col_a=[COL] gradient initial color\n"
177 " -V, --grad_col_b=[COL] gradient final color\n\n"
179 " atomes --render-png --width=1920 -H 1024 --output=image.png project.apf -s ball_and_stick\n"
180 " atomes --jpg --style=vdw -r ortho -e pc -t pc\n\n"));
181 printf (
"%s", _(
"\nReport a bug to <"));
192 printf (
"%s", _(
"\n3D atomic scale model analysis, creation/edition and post-processing tool\n"));
194 printf (
"\nGTK+ version : %1d.%1d.%1d\n",
198 printf (
"Libavutil version : %2d.%2d.%3d\n",
199 LIBAVUTIL_VERSION_MAJOR,
200 LIBAVUTIL_VERSION_MINOR,
201 LIBAVUTIL_VERSION_MICRO);
202 printf (
"Libavformat version : %2d.%2d.%3d\n",
203 LIBAVFORMAT_VERSION_MAJOR,
204 LIBAVFORMAT_VERSION_MINOR,
205 LIBAVFORMAT_VERSION_MICRO);
206 printf (
"Libavcodec version : %2d.%2d.%3d\n",
207 LIBAVCODEC_VERSION_MAJOR,
208 LIBAVCODEC_VERSION_MINOR,
209 LIBAVCODEC_VERSION_MICRO);
210 printf (
"Libswscale version : %2d.%2d.%3d\n",
211 LIBSWSCALE_VERSION_MAJOR,
212 LIBSWSCALE_VERSION_MINOR,
213 LIBSWSCALE_VERSION_MICRO);
221 v_string =
"2005-05";
225 v_string =
"2008-05";
229 v_string =
"2011-07";
233 v_string =
"2013-07";
237 v_string =
"2015-11";
241 v_string =
"2018-11";
245 v_string =
"2020-11";
249 v_string =
"2021-11";
252 v_string =
"unknown";
255 printf (
"OpenMP version : %1.1f (%s)\n", v, v_string);
257 printf (
"FC Compiler : %s\n", FC);
258 printf (
"FC Compiler flags : %s\n", FCFLAGS);
259 printf (
"C Compiler : %s\n", CC);
260 printf (
"C Compiler flags : %s\n", CFLAGS);
262 printf (
"%s", _(
"\nReport a bug to <"));
277 gchar * aext = g_strdup_printf (
"%c%c%c%c", arg[len-4], arg[len-3], arg[len-2], arg[len-1]);
278 char * eext[15]={
".awf",
".apf",
".xyz",
"NULL",
".c3d",
".trj",
"NULL",
"tcar",
"NULL",
".pdb",
".ent",
".cif",
"NULL",
"hist",
".ipf"};
279 for (i=0; i<15; i++)
if (g_strcmp0 (aext, eext[i]) == 0)
297 char * fext[15]={
"-awf",
"-apf",
" -xyz",
"NULL",
"-c3d",
"-trj",
"NULL",
"-xdatcar",
"NULL",
"-pdb",
"-ent",
"-cif",
"NULL",
"-hist",
"-ipf"};
300 gchar * str = g_ascii_strdown (arg, i);
303 if (g_strcmp0 (str, fext[j]) == 0)
326 while (* list != NULL)
328 if (g_strcmp0(* list,
string) == 0)
368 gchar * ortho_keys[] = {
"orthographic",
"ortho",
"o",
"0", NULL};
369 gchar * persp_keys[] = {
"perspective",
"persp",
"p",
"1", NULL};
398 gchar * sp_keys[] = {
"species",
"spec",
"sp",
"0", NULL};
399 gchar * pt_keys[] = {
"total_coordinations",
"total_coordination",
"total_coord",
"total",
"tc",
"t",
"1", NULL};
400 gchar * pc_keys[] = {
"partial_coordinations",
"partial_coordination",
"partial_coord",
"partial",
"pc",
"p",
"2", NULL};
401 gchar * fg_keys[] = {
"fragments",
"fragment",
"frag",
"fg",
"f",
"3", NULL};
402 gchar * mo_keys[] = {
"molecules",
"molecule",
"mol",
"mo",
"m",
"4", NULL};
421 const char *
color = color_string;
425 size_t len = strlen(
color);
426 if (len != 3 && len != 4 && len != 6 && len != 8)
432 int is_long = (len == 6 || len == 8) ? TRUE : FALSE;
433 float ratio = (is_long) ? 255.0 : 15.0;
434 int incr = (is_long) ? 2 : 1;
435 col = g_malloc0(
sizeof*
col);
441 if (is_long) buf[1] =
color[1];
442 col->red = strtol(buf, NULL, 16) / ratio;
443 buf[0] =
color[incr];
444 if (is_long) buf[1] =
color[incr+1];
445 col->green = strtol(buf, NULL, 16) / ratio;
446 buf[0] =
color[2*incr];
447 if (is_long) buf[1] =
color[2*incr+1];
448 col->blue = strtol(buf, NULL, 16) / ratio;
449 if (len == 4 || len == 8)
451 buf[0] =
color[3*incr];
452 if (is_long) buf[1] =
color[3*incr+1];
453 col->alpha = strtol(buf, NULL, 16) / ratio;
457 if (
col -> red < 0.0 || col -> red > 1.0 ||
458 col -> green < 0.0 || col -> green > 1.0 ||
459 col -> blue < 0.0 || col -> blue > 1.0 ||
460 col -> alpha < 0.0 || col -> alpha > 1.0)
477 gchar * no_keys[] = {
"none",
"no",
"n",
"0", NULL};
478 gchar * li_keys[] = {
"linear",
"lin",
"li",
"l",
"1", NULL};
479 gchar * ci_keys[] = {
"circular",
"circ",
"ci",
"c",
"2", NULL};
500 for (j=start; j<end; j++)
503 if (k > 0 && j < end-1)
519 argv[j] = argv[j+1] = g_strdup_printf (
" ");
539 struct option atomes_options[] = {{
"help", no_argument, 0,
'h'},
540 {
"version", no_argument, 0,
'v'},
541 {
"libreoffice", no_argument, 0,
'l'},
542 {
"render-png", no_argument, 0,
'p'},
543 {
"png", no_argument, 0,
'p'},
544 {
"render-jpg", no_argument, 0,
'j'},
545 {
"jpg", no_argument, 0,
'j'},
546 {
"width", required_argument, 0,
'W'},
547 {
"height", required_argument, 0,
'H'},
548 {
"output", required_argument, 0,
'o'},
549 {
"style", required_argument, 0,
's'},
550 {
"atoms", required_argument, 0,
'e'},
551 {
"poly", required_argument, 0,
't'},
552 {
"axis", required_argument, 0,
'a'},
553 {
"box", required_argument, 0,
'b'},
554 {
"box_color", required_argument, 0,
'C'},
555 {
"back_color", required_argument, 0,
'B'},
556 {
"back_grad", required_argument, 0,
'G'},
557 {
"back_dir", required_argument, 0,
'D'},
558 {
"back_pos", required_argument, 0,
'P'},
559 {
"grad_col_a", required_argument, 0,
'U'},
560 {
"grad_col_b", required_argument, 0,
'V'},
561 {
"rep", required_argument, 0,
'r'},
568 gchar * image_x = NULL;
569 gchar * image_y = NULL;
582 while ((opt = getopt_long(argc, argv,
"hvlpjdW:H:o:s:a:b:r:e:t:B:C:G:D:P:U:V:", atomes_options, & index)) != -1)
599 img_opt += (index == -1) ? 1 : 0;
606 img_opt += (index == -1) ? 1 : 0;
625 img_opt += (index == -1) ? 1 : 0;
628 image_x = g_strdup_printf (
"%s", optarg);
630 img_opt += (index == -1) ? 1 : 0;
633 image_y = g_strdup_printf (
"%s", optarg);
635 img_opt += (index == -1) ? 1 : 0;
640 img_opt += (index == -1) ? 1 : 0;
645 img_opt += (index == -1) ? 1 : 0;
650 img_opt += (index == -1) ? 1 : 0;
655 img_opt += (index == -1) ? 1 : 0;
660 img_opt += (index == -1) ? 1 : 0;
665 img_opt += (index == -1) ? 1 : 0;
670 img_opt += (index == -1) ? 1 : 0;
673 if (isdigit(optarg[0]))
678 img_opt += (index == -1) ? 1 : 0;
684 img_opt += (index == -1) ? 1 : 0;
689 img_opt += (index == -1) ? 1 : 0;
694 img_opt += (index == -1) ? 1 : 0;
703 if (argc == img_opt + 2)
705 if (image_x || image_y)
727 for (i=optind; i<argc; i++)
741 ftmp -> next = g_malloc0(
sizeof*
ftmp -> next);
744 ftmp -> file_name = g_strdup_printf (
"%s", argv[i]);
745 ftmp -> file_type = -j;
765 GtkWidget * splashi = (GtkWidget*) user_data;
780G_MODULE_EXPORT gboolean splashdraw (GtkWidget * widget, cairo_t * cr, gpointer data)
782 cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
796 gtk_window_set_decorated (GTK_WINDOW (splash_window), FALSE);
800 gchar * backcol = g_strdup_printf (
"window#splash {\n"
802 " background-color: rgba(255, 255, 255, 0);}");
804 gtk_widget_set_name (splash_window,
"splash");
807 gtk_window_set_type_hint (GTK_WINDOW (splash_window), GDK_WINDOW_TYPE_HINT_SPLASHSCREEN);
808 gtk_window_set_position (GTK_WINDOW (splash_window), GTK_WIN_POS_CENTER_ALWAYS);
809 gtk_widget_set_app_paintable (splash_window, TRUE);
810 GdkScreen * screen = gtk_widget_get_screen (splash_window);
811 GdkVisual * visual = gdk_screen_get_rgba_visual (screen);
812 gtk_widget_set_visual (splash_window, visual);
814 g_signal_connect(G_OBJECT(splash_window),
"draw", G_CALLBACK(splashdraw), NULL);
818 gtk_window_set_transient_for ((GtkWindow *)splash_window, (GtkWindow *)
MainWindow);
820 return splash_window;
833 FILE *
fp = fopen (this_file,
dfi[0]);
839 gchar * err = g_strdup_printf (_(
"Error while reading workspace file\n%s\n"), this_file);
881 end = g_strdup_printf (
"%c", file_name[strlen(file_name)-1]);
882 if (g_strcmp0 (file_name,
"*") == 0 || g_strcmp0 (end,
"*") == 0)
884 if (g_strcmp0 (file_name,
"*") == 0)
886 filedir = g_strdup_printf (
"./");
890 filedir = g_strdup_printf (
"%c", file_name[0]);
891 for (i=1; i<strlen(file_name)-1; i++) filedir = g_strdup_printf (
"%s%c", filedir, file_name[i]);
894 hFind = FindFirstFile (filedir, & ffd);
895 if (hFind != INVALID_HANDLE_VALUE)
897 if (ffd.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
899 str = g_strdup_printf (
"%s\\%s", filedir, (gchar *)ffd.cFileName);
903 while (FindNextFile(hFind, &ffd) != 0)
905 if (ffd.dwFileAttributes & ! FILE_ATTRIBUTE_DIRECTORY)
907 str = g_strdup_printf (
"%s\\%s", filedir, (gchar *)ffd.cFileName);
915 d = opendir (filedir);
918 while ((dir = readdir(d)) != NULL)
920 if (dir -> d_type == DT_REG)
922 str = g_strdup_printf (
"%s/%s", filedir, dir -> d_name);
942 end = g_strdup_printf (
"%c", file_name[strlen(file_name)-1]);
943 if (g_strcmp0 (file_name,
"*") == 0 || g_strcmp0 (end,
"*") == 0)
945 if (g_strcmp0 (file_name,
"*") == 0)
947 filedir = g_strdup_printf (
"./");
951 filedir = g_strdup_printf (
"%c", file_name[0]);
952 for (i=1; i<strlen(file_name)-1; i++) filedir = g_strdup_printf (
"%s%c", filedir, file_name[i]);
955 hFind = FindFirstFile (filedir, & ffd);
956 if (hFind != INVALID_HANDLE_VALUE)
958 if (ffd.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
961 active_project -> coordfile = g_strdup_printf (
"%s\\%s", filedir, (gchar *)ffd.cFileName);
964 while (FindNextFile(hFind, &ffd) != 0)
966 if (ffd.dwFileAttributes & ! FILE_ATTRIBUTE_DIRECTORY)
969 active_project -> coordfile = g_strdup_printf (
"%s\\%s", filedir, (gchar *)ffd.cFileName);
976 d = opendir (filedir);
979 while ((dir = readdir(d)) != NULL)
981 if (dir -> d_type == DT_REG)
984 active_project -> coordfile = g_strdup_printf (
"%s/%s", filedir, dir -> d_name);
1016 setlocale (LC_NUMERIC,
"C");
1017 GtkSettings * default_settings = gtk_settings_get_default ();
1024 g_object_set (default_settings,
"gtk-button-images", TRUE, NULL);
1028 g_object_set (default_settings,
"gtk-key-theme-name",
"win32", NULL);
1037#ifdef MAC_INTEGRATION
1038 GtkosxApplication * ProgOSX;
1039 ProgOSX = g_object_new (GTKOSX_TYPE_APPLICATION, NULL);
1040 gtkosx_application_set_use_quartz_accelerators (ProgOSX, FALSE);
1041 gtkosx_application_ready (ProgOSX);
1051 if (isplash == NULL)
1053 g_warning (_(
"Impossible to load the splash screen\n"));
1068 if (
ftmp -> file_type == 1)
1079 if (
ftmp -> file_type != 1)
1090#ifdef MAC_INTEGRATION
1091 g_object_unref (ProgOSX);
1102 GError * error = NULL;
1103 gchar * proc_dir = NULL;
1104 gchar * proc_path = NULL;
1105 const char * proc_name;
1107 proc_dir = g_build_filename (PACKAGE_PREFIX,
"bin", NULL);
1108 proc_name =
"atomes_startup_testing.exe";
1109 proc_path = g_build_filename (proc_dir, proc_name, NULL);
1111 proc_dir = g_build_filename (PACKAGE_LIBEXEC, NULL);
1112 proc_name =
"atomes_startup_testing";
1113 proc_path = g_build_filename (PACKAGE_LIBEXEC, proc_name, NULL);
1116 g_print (
"proc_dir= %s\n", proc_dir);
1117 g_print (
"proc_name= %s\n", proc_name);
1118 g_print (
"proc_path= %s\n", proc_path);
1122 GSubprocess * proc = g_subprocess_new (G_SUBPROCESS_FLAGS_NONE, & error, proc_path, NULL);
1125 GSubprocessLauncher * proc_launch = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE);
1126 g_subprocess_launcher_set_cwd (proc_launch, proc_dir);
1127 GSubprocess * proc = g_subprocess_launcher_spawn (proc_launch, & error, proc_path, NULL);
1129 GSubprocess * proc = g_subprocess_new (G_SUBPROCESS_FLAGS_NONE, & error, proc_path, NULL);
1135 g_print (
"error: %s\n", error -> message);
1136 g_clear_error (& error);
1138 g_subprocess_wait (proc, NULL, & error);
1139 int res = g_subprocess_get_exit_status (proc);
1141 g_debug (
"Exit status of atomes_startup_testing = %d",
res);
1143 g_object_unref (proc);
1146 g_object_unref (proc_launch);
1151 gchar * ogl_info = NULL;
1155 ogl_info = g_strdup_printf (_(
"Fatal error on OpenGL initialization: trying to adjust environment !"));
1158 ogl_info = g_strdup_printf (_(
"Impossible to initialize the OpenGL 3D rendering !"));
1161 ogl_info = g_strdup_printf (_(
"GDK visual must be modified to initialize the OpenGL context !"));
1168 g_print (
"%s\n", ogl_info);
1185 gboolean RUNC = FALSE;
1188 PACKAGE_PREFIX = g_win32_get_package_installation_directory_of_module (NULL);
1189 PACKAGE_LOCALE = g_build_filename (PACKAGE_PREFIX,
"locale", NULL);
1193 PACKAGE_IMP = g_build_filename (PACKAGE_PREFIX,
"pixmaps/import.png", NULL);
1194 PACKAGE_IMP = g_build_filename (PACKAGE_PREFIX,
"pixmaps/import.png", NULL);
1195 PACKAGE_CON = g_build_filename (PACKAGE_PREFIX,
"pixmaps/convert.png", NULL);
1196 PACKAGE_IMG = g_build_filename (PACKAGE_PREFIX,
"pixmaps/image.png", NULL);
1197 PACKAGE_PDF = g_build_filename (PACKAGE_PREFIX,
"pixmaps/pdf.png", NULL);
1198 PACKAGE_SVG = g_build_filename (PACKAGE_PREFIX,
"pixmaps/svg.png", NULL);
1199 PACKAGE_EPS = g_build_filename (PACKAGE_PREFIX,
"pixmaps/eps.png", NULL);
1200 PACKAGE_PNG = g_build_filename (PACKAGE_PREFIX,
"pixmaps/png.png", NULL);
1201 PACKAGE_JPG = g_build_filename (PACKAGE_PREFIX,
"pixmaps/jpg.png", NULL);
1202 PACKAGE_BMP = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bmp.png", NULL);
1203 PACKAGE_TIFF = g_build_filename (PACKAGE_PREFIX,
"pixmaps/tiff.png", NULL);
1204 PACKAGE_VOID = g_build_filename (PACKAGE_PREFIX,
"pixmaps/void.png", NULL);
1205 PACKAGE_TD = g_build_filename (PACKAGE_PREFIX,
"pixmaps/td.png", NULL);
1206 PACKAGE_MOL = g_build_filename (PACKAGE_PREFIX,
"pixmaps/molecule.png", NULL);
1207 PACKAGE_OGL = g_build_filename (PACKAGE_PREFIX,
"pixmaps/opengl.png", NULL);
1208 PACKAGE_OGLM = g_build_filename (PACKAGE_PREFIX,
"pixmaps/mol.png", NULL);
1209 PACKAGE_OGLC = g_build_filename (PACKAGE_PREFIX,
"pixmaps/mol.png", NULL);
1210 PACKAGE_PRO = g_build_filename (PACKAGE_PREFIX,
"pixmaps/prop.png", NULL);
1211 PACKAGE_SET = g_build_filename (PACKAGE_PREFIX,
"pixmaps/settings.png", NULL);
1212 PACKAGE_LOGO = g_build_filename (PACKAGE_PREFIX,
"pixmaps/logo.png", NULL);
1213 PACKAGE_LAGPL = g_build_filename (PACKAGE_PREFIX,
"pixmaps/logo-agpl.png", NULL);
1214 PACKAGE_LABOUT = g_build_filename (PACKAGE_PREFIX,
"pixmaps/logo-about.png", NULL);
1215 PACKAGE_DOTA = g_build_filename (PACKAGE_PREFIX,
"pixmaps/dots/dots-a.png", NULL);
1216 PACKAGE_DOTB = g_build_filename (PACKAGE_PREFIX,
"pixmaps/dots/dots-b.png", NULL);
1217 PACKAGE_DOTC = g_build_filename (PACKAGE_PREFIX,
"pixmaps/dots/dots-c.png", NULL);
1218 PACKAGE_DOTD = g_build_filename (PACKAGE_PREFIX,
"pixmaps/dots/dots-d.png", NULL);
1219 PACKAGE_DOTE = g_build_filename (PACKAGE_PREFIX,
"pixmaps/dots/dots-e.png", NULL);
1220 PACKAGE_DOTF = g_build_filename (PACKAGE_PREFIX,
"pixmaps/dots/dots-f.png", NULL);
1221 PACKAGE_DOTG = g_build_filename (PACKAGE_PREFIX,
"pixmaps/dots/dots-g.png", NULL);
1222 PACKAGE_DOTH = g_build_filename (PACKAGE_PREFIX,
"pixmaps/dots/dots-h.png", NULL);
1223 PACKAGE_DFBD = g_build_filename (PACKAGE_PREFIX,
"pixmaps/field/bd.png", NULL);
1224 PACKAGE_DFAN = g_build_filename (PACKAGE_PREFIX,
"pixmaps/field/an.png", NULL);
1225 PACKAGE_DFDI = g_build_filename (PACKAGE_PREFIX,
"pixmaps/field/di.png", NULL);
1226 PACKAGE_DFTD = g_build_filename (PACKAGE_PREFIX,
"pixmaps/field/td.png", NULL);
1227 PACKAGE_DFIN = g_build_filename (PACKAGE_PREFIX,
"pixmaps/field/in.png", NULL);
1228 PACKAGE_SGCP = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Cubic-P.png", NULL);
1229 PACKAGE_SGCI = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Cubic-I.png", NULL);
1230 PACKAGE_SGCF = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Cubic-F.png", NULL);
1231 PACKAGE_SGHP = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Hexagonal.png", NULL);
1232 PACKAGE_SGTR = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Trigonal-R.png", NULL);
1233 PACKAGE_SGTI = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Tetragonal-I.png", NULL);
1234 PACKAGE_SGTP = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Tetragonal-P.png", NULL);
1235 PACKAGE_SGOP = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Orthorhombic-P.png", NULL);
1236 PACKAGE_SGOI = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Orthorhombic-I.png", NULL);
1237 PACKAGE_SGOC = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Orthorhombic-C.png", NULL);
1238 PACKAGE_SGOF = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Orthorhombic-F.png", NULL);
1239 PACKAGE_SGMP = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Monoclinic-P.png", NULL);
1240 PACKAGE_SGMI = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Monoclinic-I.png", NULL);
1241 PACKAGE_SGTC = g_build_filename (PACKAGE_PREFIX,
"pixmaps/bravais/Triclinic.png", NULL);
1264 g_setenv (
"GSK_RENDERER",
"gl", TRUE);
1265 g_setenv (
"GDK_DEBUG",
"gl-prefer-gl", TRUE);
1270 g_setenv (
"GDK_RENDERER",
"ngl", TRUE);
1280 g_setenv (
"GSK_RENDERER",
"gl", TRUE);
1285 PWSTR localPath = NULL;
1286 HRESULT hr = SHGetKnownFolderPath (& FOLDERID_LocalAppData, 0, NULL, & localPath);
1289 fprintf (stderr, _(
"Error impossible to obtain the AppData\\Roaming (code 0x%08lx)\n%s"), hr);
1295 char appdata[MAX_PATH];
1296 wcstombs (appdata, localPath, MAX_PATH);
1297 CoTaskMemFree (localPath);
1303 struct passwd * pw = getpwuid(getuid());
1308 bindtextdomain (
PACKAGE, PACKAGE_LOCALE);
1310 bind_textdomain_codeset(
PACKAGE,
"UTF-8");
1314#if GLIB_MINOR_VERSION < 74
1315 AtomesApp = gtk_application_new (g_strdup_printf (
"fr.ipcms.atomes.prog-%d", (
int)clock()), G_APPLICATION_FLAGS_NONE);
1317 AtomesApp = gtk_application_new (g_strdup_printf (
"fr.ipcms.atomes.prog-%d", (
int)clock()), G_APPLICATION_DEFAULT_FLAGS);
1319 GError * error = NULL;
1320 g_application_register (G_APPLICATION(
AtomesApp), NULL, & error);
Binding to the Fortran90 subroutines.
int open_save_workspace(FILE *fp, int act)
open or save the active workspace
void open_this_coordinate_file(int format, gchar *proj_name)
open coordinate file format, if successful add to workspace
int open_save(FILE *fp, int act, int wid, int pid, int aid, gchar *pfile)
open or save project file
void open_this_isaacs_xml_file(gchar *profile, int ptoc, gboolean visible)
open an ISAACS XML file
Callback declarations for main window.
#define PACKAGE_BUGREPORT
GtkApplication * AtomesApp
gboolean atomes_render_image
int * allocint(int val)
allocate an int * pointer
gchar * ATOMES_CONFIG_DIR
double string_to_double(gpointer string)
convert string to double
gboolean atomes_from_libreoffice
Global variable declarations Global convenience function declarations Global data structure defin...
GtkWidget * new_gtk_window()
create a new GtkWindow
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void provide_gtk_css(gchar *css)
create a css provider based on the css data
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
ColRGBA * render_image_grad_color[2]
ColRGBA * render_image_box_color
ColRGBA * render_image_back_color
int * render_image_pixels
int render_image_back_grad
gboolean trigger_fragment_analysis
float render_image_back_pos
int render_image_back_dir
gchar * render_image_output
gboolean trigger_molecule_analysis
void init_project(gboolean alloc_box)
initialize a new project
void show_error(char *error, int val, GtkWidget *win)
show error message
Messaging function declarations.
int get_color_map_from_string(gchar *col_string)
retrieve color map from command line string
int get_rep_from_string(gchar *rep_string)
retrieve representation style from command line string
int main(int argc, char *argv[])
initialization of the atomes program
int check_opengl_rendering()
check the initialization parameters for an OpenGL context
int test_this_arg(gchar *arg)
test an argument from the command line
int get_box_axis_from_string(gchar *box_axis_string)
retrieve box or axis style from command line string
GtkWidget * create_splash_window()
create splash screen window
void print_version()
print version information
ColRGBA * get_color_from_hexa_string(gchar *color_string)
convert Hexadecimal string to ColRGBA
gboolean is_string_in_string_list(gchar *string, gchar **list)
check if a string is in a list of strings
int get_gradient_from_string(gchar *grad_string)
retrieve background gradient from command line string
void print_help()
print basic help
GtkWidget * create_main_window(GApplication *app)
create the main application window
gboolean destroy_func(gpointer user_data)
destroy splash screen
int parse_command_line(int argc, char *argv[])
test command line arguments
int test_this_ext(int len, gchar *arg)
test extension of an argument from the command line
G_MODULE_EXPORT void run_program(GApplication *app, gpointer data)
run the program
void open_this_data_file(int file_type, gchar *file_name)
open data file from the command line
int check_for_atomes_file_options(int start, int end, char *argv[])
retrieve the list of files to read from the command line leave out all other options
void read_this_file(int file_type, gchar *this_file)
read file from the command line
int get_style_from_string(gchar *style_string)
retrieve style from command line string
Data structure declarations for movie encoding Function declarations for movie encoding.
void set_atomes_preferences()
set software default parameters
Preference variable declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
Function declarations for workspace managment.