atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
cpmd_atoms.c
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-2026 by CNRS and University of Strasbourg */
15
21
22/*
23* This file: 'cpmd_atoms.c'
24*
25* Contains:
26*
27
28 - The functions to handle dummy atom(s) for the CPMD input file
29
30*
31* List of functions:
32
33 void create_dummy_param_box (int dummy_id);
34 void dummy_set_color (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
35 void dummy_set_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
36 void clean_dummy_widgets ();
37 void remove_dummy (int num_to_remove);
38 void add_dummy (int extra);
39
40 G_MODULE_EXPORT void update_dummy_coord (GtkEntry * res, gpointer data);
41 G_MODULE_EXPORT void dummy_type_changed (GtkComboBox * box, gpointer data);
42 G_MODULE_EXPORT void changed_dummy_id_box (GtkComboBox * box, gpointer data);
43 G_MODULE_EXPORT void select_dummy (GtkCellRendererToggle * cell_renderer, gchar * string_path, gpointer data);
44 G_MODULE_EXPORT void run_remove_dummy (GtkDialog * dialog, gint response_id, gpointer data);
45 G_MODULE_EXPORT void add_or_remove_dummy (GtkSpinButton * res, gpointer data);
46 G_MODULE_EXPORT void atom_button (GtkWidget * but, gpointer data);
47
48 GtkWidget * create_dummy_box ();
49
50 dummy_atom * get_active_dummy (int id);
51 dummy_atom * init_dummy (int type, int id);
52
53*/
54
55#include "global.h"
56#include "interface.h"
57#include "glview.h"
58#include "calc.h"
59#include "cpmd.h"
60
61extern void create_selection_combo (int id, int num, int type, GCallback handler);
62extern void print_the_section (int s, int p, GtkTextBuffer * buffer);
63extern void create_selection_button (GtkWidget * box, int num, int id, gpointer data);
64extern G_MODULE_EXPORT void changed_opt_box (GtkComboBox * box, gpointer data);
65extern GtkWidget * combo_id[2];
66extern GtkWidget * combo_id_box[2];
67extern ColRGBA init_color (int id, int numid);
68extern int num_cpmd_objects;
69
70GtkWidget * dummy_box[2];
71GtkWidget * the_dummy_box;
72GtkWidget * dummy_param_box;
76GtkCellRenderer * dummy_renderer[5];
77GtkTreeViewColumn * dummy_col[5];
78
87{
88 dummy_atom * dumm = tmp_cpmd -> dummy;
89 while (dumm -> id != id)
90 {
91 if (dumm -> next != NULL) dumm = dumm -> next;
92 }
93 return dumm;
94}
95
104G_MODULE_EXPORT void update_dummy_coord (GtkEntry * res, gpointer data)
105{
106 int i;
107 i = GPOINTER_TO_INT(data);
108 const gchar * m = entry_get_text (res);
109 double v = string_to_double ((gpointer)m);
110 dummy -> xyz[i] = v;
111 update_entry_double (res, dummy -> xyz[i]);
112 print_the_section (8, 0, qmbuffer[8]);
113}
114
115void create_dummy_param_box (int dummy_id);
116
125G_MODULE_EXPORT void dummy_type_changed (GtkComboBox * box, gpointer data)
126{
127 int i;
128 i = combo_get_active ((GtkWidget *)box);
129 if (i != dummy -> type)
130 {
131 dummy -> type = i;
133 }
134 print_the_section (8, 0, qmbuffer[8]);
135}
136
144void create_dummy_param_box (int dummy_id)
145{
146 gchar * str;
148 if (tmp_cpmd -> dummies > 0)
149 {
150 GtkWidget * hbox;
151 GtkWidget * widg;
152 str = g_strdup_printf (_("Configuration for dummy atom N°<b>%d</b>: "), dummy_id+1);
154 cpmd_box (dummy_box[1], str, 0, 5, 280);
155 g_free (str);
156 int i;
157 hbox = cpmd_box (dummy_box[1], _("Type of dummy atom:"), 0, 25, -1);
158 GtkWidget * box = create_combo ();
159 gchar * dtext[3] = {i18n("fixed in space:"),
160 i18n("calculated by\nthe arithmetic mean of the coordinates of the selected atom(s)"),
161 i18n("calculated by\nthe center of mass of the coordinates of the selected atom(s)")};
162 for (i=0; i<3; i++)
163 {
164 str = g_strdup_printf ("%s %d", _("Type"), i+1);
165 combo_text_append (box, str);
166 g_free (str);
167 }
168 g_signal_connect (G_OBJECT (box), "changed", G_CALLBACK(dummy_type_changed), NULL);
169 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, box, FALSE, FALSE, 10);
170 dummy = get_active_dummy (dummy_id);
171 str = g_strdup_printf (_("The coordinates of the dummy atom are %s"), _(dtext[dummy -> type]));
172
173 hbox = create_hbox (0);
174 add_box_child_start (GTK_ORIENTATION_VERTICAL, dummy_box[1], hbox, FALSE, FALSE, 0);
175 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(str, -1, (dummy -> type == 0) ? 40 : 60, 0.0, 0.5), FALSE, FALSE, 25);
176 g_free (str);
177 if (dummy -> type > 0)
178 {
179 create_selection_button (dummy_box[1], dummy -> natoms, 2, GINT_TO_POINTER(-(dummy -> id + 2)));
180 }
181 else
182 {
183 gchar * lcoo[3]={"<b>x</b>", "<b>y</b>", "<b>z</b>"};
184
185 for (i=0; i<3; i++)
186 {
187 str = g_strdup_printf (_("Dummy %s coordinate: "), lcoo[i]);
188 hbox = cpmd_box (dummy_box[1], str, 0, 25, -1);
189 widg = create_entry (G_CALLBACK(update_dummy_coord), 100, 15, FALSE, GINT_TO_POINTER(i));
190 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, widg, FALSE, FALSE, 10);
191 update_entry_double (GTK_ENTRY(widg), dummy -> xyz[i]);
192 }
193 }
194 combo_set_active (box, dummy -> type);
195 add_box_child_start (GTK_ORIENTATION_VERTICAL, dummy_box[0], dummy_box[1], FALSE, FALSE, 0);
197 }
198}
199
208G_MODULE_EXPORT void changed_dummy_id_box (GtkComboBox * box, gpointer data)
209{
210 int i;
211 i = combo_get_active ((GtkWidget *)box);
213}
214
223dummy_atom * init_dummy (int type, int id)
224{
225 dummy_atom * dumm = g_malloc0(sizeof*dumm);
226 dumm -> id = id;
227 dumm -> type = type;
228 dumm -> show = FALSE;
229 dumm -> natoms = 0;
230 dumm -> list = NULL;
231 dumm -> xyz[0] = 0.0;
232 dumm -> xyz[1] = 0.0;
233 dumm -> xyz[2] = 0.0;
234 return dumm;
235}
236
246G_MODULE_EXPORT void select_dummy (GtkCellRendererToggle * cell_renderer, gchar * string_path, gpointer data)
247{
248 GtkTreeStore ** model = (GtkTreeStore **)data;
249 GtkTreeIter iter;
250 GtkTreePath * path = gtk_tree_path_new_from_string (string_path);
251 gtk_tree_model_get_iter (GTK_TREE_MODEL(* model), & iter, path);
252 if (gtk_cell_renderer_toggle_get_active(cell_renderer))
253 {
254 get_active_dummy (old_dummy[n_dummy-1]) -> show = FALSE;
255 old_dummy[n_dummy-1] = -1;
256 n_dummy --;
257 gtk_tree_store_set (* model, & iter, 4, 0, -1);
258 //toviz.c = 0;
259 }
260 else
261 {
262 n_dummy ++;
263 gtk_tree_store_set (* model, & iter, 4, 1, -1);
264 gtk_tree_model_get (GTK_TREE_MODEL(* model), & iter, 0, & old_dummy[n_dummy-1], -1);
265 old_dummy[n_dummy-1] --;
266 get_active_dummy (old_dummy[n_dummy-1]) -> show = TRUE;
267 //toviz.c = 1;
268 }
269 // Viz
270}
271
283void dummy_set_color (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
284{
285 int i;
286 gtk_tree_model_get (mod, iter, 0, & i, -1);
287 i = abs(i);
288 set_renderer_color (get_active_dummy (i-1) -> show, renderer, init_color (i-1, num_cpmd_objects));
289}
290
302void dummy_set_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
303{
304 int i, j;
305 i = GPOINTER_TO_INT(data);
306 gtk_tree_model_get (mod, iter, 0, & j, -1);
307 if (j > 0 && i != 3)
308 {
309 gtk_cell_renderer_set_visible (renderer, TRUE);
310 if (i < 3) dummy_set_color (col, renderer, mod, iter, data);
311 }
312 else if (j > 0)
313 {
314 gtk_cell_renderer_set_visible (renderer, FALSE);
315 }
316 else if (i == 3)
317 {
318 gtk_cell_renderer_set_visible (renderer, TRUE);
319 dummy_set_color (col, renderer, mod, iter, data);
320 }
321 else
322 {
323 gtk_cell_renderer_set_visible (renderer, FALSE);
324 }
325}
326
327GtkWidget * create_dummy_box ();
328
342
352G_MODULE_EXPORT void run_remove_dummy (GtkDialog * dialog, gint response_id, gpointer data)
353{
354 int i, j;
355 gboolean done = FALSE;
356 int num_to_remove = GPOINTER_TO_INT(data);
357 dummy_atom * dumm;
358 gchar * str;
359 switch (response_id)
360 {
361 case GTK_RESPONSE_APPLY:
362 if (n_dummy == num_to_remove)
363 {
364 done = TRUE;
365 // Now we remove all selected dummy atoms
366 for (i=0; i<n_dummy; i++)
367 {
368 dumm = tmp_cpmd -> dummy;
369 for (j=0; j<tmp_cpmd -> dummies; j++)
370 {
371 if (dumm -> id == old_dummy[i])
372 {
373 if (dumm -> next != NULL)
374 {
375 if (dumm -> prev != NULL)
376 {
377 dumm -> next -> prev = dumm -> prev;
378 dumm -> prev -> next = dumm -> next;
379 }
380 else
381 {
382 tmp_cpmd -> dummy = dumm -> next;
383 tmp_cpmd -> dummy -> prev = NULL;
384 }
385 g_free (dumm);
386 }
387 else if (dumm -> prev != NULL)
388 {
389 dumm -> prev -> next = NULL;
390 g_free (dumm);
391 }
392 else
393 {
394 g_free (tmp_cpmd -> dummy);
395 tmp_cpmd -> dummy = NULL;
396 }
397 break;
398 }
399 if (dumm -> next != NULL) dumm = dumm -> next;
400 }
401 }
402 tmp_cpmd -> dummies -= num_to_remove;
403 if (tmp_cpmd -> dummies > 0)
404 {
405 dumm = tmp_cpmd -> dummy;
406 for (j=0; j<tmp_cpmd -> dummies; j++)
407 {
408 dumm -> id = j;
409 if (dumm -> next != NULL) dumm = dumm -> next;
410 }
411 }
414 add_box_child_start (GTK_ORIENTATION_VERTICAL, dummy_param_box, the_dummy_box, FALSE, FALSE, 0);
416 }
417 else
418 {
419 str = g_strdup_printf (_("You must select %d dummy atom(s) to be deleted !"), num_to_remove);
421 g_free (str);
422 }
423 break;
424 default:
425 // field_unselect_all ();
426 done = TRUE;
427 break;
428 }
429 if (done) destroy_this_dialog (dialog);
430}
431
439void remove_dummy (int num_to_remove)
440{
441 int i, j, k;
442 gchar * str;
443 str = g_strdup_printf (_("Select the %d dummy atom(s) to be removed"), num_to_remove);
444 GtkWidget * rdummy = dialogmodal (str, GTK_WINDOW(qm_assistant));
445 g_free (str);
446 gtk_dialog_add_button (GTK_DIALOG(rdummy), _("Apply"), GTK_RESPONSE_APPLY);
447
448 gchar * mol_title[5] = {i18n("Id."), i18n("Type"), i18n("Atom(s)"), " ", i18n("Select")};
449 gchar * ctype[5] = {"text", "text", "text", "text", "active"};
450 GType col_type[5] = {G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN};
451
452 GtkTreeIter dummy_level, atom_level;
453 n_dummy = 0;
454 old_dummy = allocint (tmp_cpmd -> dummies);
455 GtkTreeStore * remove_model = gtk_tree_store_newv (5, col_type);
456 GtkWidget * remove_tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(remove_model));
457 for (i=0; i<5; i++)
458 {
459 if (i < 4)
460 {
461 dummy_renderer[i] = gtk_cell_renderer_text_new ();
462 }
463 else
464 {
465 dummy_renderer[i] = gtk_cell_renderer_toggle_new ();
466 gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE(dummy_renderer[i]), TRUE);
467 g_signal_connect (G_OBJECT(dummy_renderer[i]), "toggled", G_CALLBACK(select_dummy), & remove_model);
468 }
469 dummy_col[i] = gtk_tree_view_column_new_with_attributes ((i != 3) ? _(mol_title[i]) : mol_title[i], dummy_renderer[i], ctype[i], i, NULL);
470 gtk_tree_view_column_set_alignment (dummy_col[i], 0.5);
471 gtk_tree_view_append_column (GTK_TREE_VIEW(remove_tree), dummy_col[i]);
472 gtk_tree_view_column_set_cell_data_func (dummy_col[i], dummy_renderer[i], dummy_set_visible, GINT_TO_POINTER(i), NULL);
473 }
474 // fill model
475 dummy_atom * dumm = tmp_cpmd -> dummy;
476 for (i=0; i<tmp_cpmd -> dummies; i++)
477 {
478 gtk_tree_store_append (remove_model, & dummy_level, NULL);
479 gtk_tree_store_set (remove_model, & dummy_level, 0, i+1,
480 1, g_strdup_printf ("%s %d", _("Type"), dumm -> type + 1),
481 2, dumm -> natoms,
482 3, NULL,
483 4, 0, -1);
484 for (j=0; j<dumm -> natoms; j++)
485 {
486 gtk_tree_store_append (remove_model, & atom_level, & dummy_level);
487 k = qm_proj -> atoms[0][dumm -> list[j]].sp;
488 str = g_strdup_printf ("%s<sub>%d</sub>", exact_name(qm_proj -> chemistry -> label[k]), dumm -> list[j]+1);
489 gtk_tree_store_set (remove_model, & atom_level, 0, -(i+1), 1, 0.0, 2, 0.0, 3, str, 4, 0, -1);
490 g_free (str);
491 }
492 if (dumm -> next != NULL) dumm = dumm -> next;
493 }
494 num_cpmd_objects = tmp_cpmd -> dummies;
495 g_object_unref (remove_model);
496
497 i = ((tmp_cpmd -> dummies+1)*40 < 500) ? (tmp_cpmd -> dummies+1)*40 : 500;
498 GtkWidget * scrollsets = create_scroll (dialog_get_content_area (rdummy), 450, i, GTK_SHADOW_ETCHED_IN);
499 add_container_child (CONTAINER_SCR, scrollsets, remove_tree);
500 run_this_gtk_dialog (rdummy, G_CALLBACK(run_remove_dummy), GINT_TO_POINTER(num_to_remove));
501}
502
503
511void add_dummy (int extra)
512{
513 int i;
514 if (tmp_cpmd -> dummy == NULL)
515 {
516 tmp_cpmd -> dummy = init_dummy (0, 0);
517 tmp_cpmd -> dummies = 1;
518 extra --;
519 }
520 dummy_atom * dumm = tmp_cpmd -> dummy;
521 while (dumm -> next != NULL) dumm = dumm -> next;
522 for (i=0; i<extra; i++)
523 {
524 dumm -> next = init_dummy (0, i+tmp_cpmd -> dummies);
525 dumm -> next -> prev = dumm;
526 dumm = dumm -> next;
527 }
528
529 tmp_cpmd -> dummies += extra;
530 // finaly update the combobox
531 create_selection_combo (1, tmp_cpmd -> dummies, 0, G_CALLBACK(changed_dummy_id_box));
532}
533
542G_MODULE_EXPORT void add_or_remove_dummy (GtkSpinButton * res, gpointer data)
543{
544 int id = gtk_spin_button_get_value_as_int(res);
545 int k;
546 gchar * str;
547 gboolean to_add_dummy = TRUE;
548 if (id != tmp_cpmd -> dummies)
549 {
550 if (id > tmp_cpmd -> dummies)
551 {
552 // adding dummy
553 k = id - tmp_cpmd -> dummies;
554 if (k > 1)
555 {
556 str = g_strdup_printf (_("Do you really want to add %d dummy atom(s) ?"), k);
557 to_add_dummy = ask_yes_no (_("Adding dummy atom(s) ?"), str, GTK_MESSAGE_QUESTION, qm_assistant);
558 g_free (str);
559 }
560 if (to_add_dummy)
561 {
562 add_dummy (k);
563 }
564 }
565 else if (id < tmp_cpmd -> dummies)
566 {
567 remove_dummy (tmp_cpmd -> dummies - id);
568 }
569 }
570 gtk_spin_button_set_value (GTK_SPIN_BUTTON(res), tmp_cpmd -> dummies);
571 print_the_section (8, 0, qmbuffer[8]);
572}
573
579GtkWidget * create_dummy_box ()
580{
581 GtkWidget * vbox = create_vbox (BSEP);
582 GtkWidget * hbox;
583 GtkWidget * widg;
584 hbox = cpmd_box (vbox, _("Number of dummy atom(s):"), 5, 20, 200);
585 widg = spin_button (G_CALLBACK(add_or_remove_dummy),
586 tmp_cpmd -> dummies, 0.0, (double)qm_proj -> natomes, 1.0, 0, 100, NULL);
587 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, widg, FALSE, FALSE, 0);
588 combo_id[1] = cpmd_box (vbox, _("Dummy atom to configure: "), 5, 5, 200);
590 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, dummy_box[0], FALSE, FALSE, 10);
591 create_selection_combo (1, tmp_cpmd -> dummies, 0, G_CALLBACK(changed_dummy_id_box));
592 return vbox;
593}
594
603G_MODULE_EXPORT void atom_button (GtkWidget * but, gpointer data)
604{
605 int i, j;
606 i = GPOINTER_TO_INT(data);
607 GtkWidget * amol = dialogmodal ((i == DEFCO) ? _("Add and configure constraint(s)") : _("Add and configure dummy atoms"), GTK_WINDOW(qm_assistant));
608 GtkWidget * vbox = dialog_get_content_area (amol);
609 GtkWidget * hbox;
610 GtkWidget * widg;
611 gchar * str;
612 if (i == DEFCO)
613 {
614 hbox = cpmd_box (vbox, _(default_opts[5][1]), 5, 20, 120);
615 widg = create_combo ();
616 for (j=0; j<defaut_num[5]; j++)
617 {
618 str = g_strdup_printf ("%s", _(default_text[5][j]));
619 combo_text_append (widg, str);
620 g_free (str);
621 }
622 combo_set_active (widg, (int)tmp_cpmd -> default_opts[i+1]);
623 g_signal_connect (G_OBJECT (widg), "changed", G_CALLBACK(changed_opt_box), GINT_TO_POINTER(i+1));
624 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, widg, FALSE, FALSE, 0);
625 create_selection_button (vbox, tmp_cpmd -> fixat, 1, GINT_TO_POINTER(-1));
626 j = (tmp_cpmd -> default_opts[i+1] < 0.0) ? 0 : (int) tmp_cpmd -> default_opts[i+1];
628 }
629 else if (i == DEFDU)
630 {
631 dummy_box[0] = NULL;
632 dummy_box[1] = NULL;
633 combo_id[1] = NULL;
635 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, dummy_param_box, FALSE, FALSE, 0);
637 add_box_child_start (GTK_ORIENTATION_VERTICAL, dummy_param_box, the_dummy_box, FALSE, FALSE, 0);
638 }
639 run_this_gtk_dialog (amol, G_CALLBACK(run_destroy_dialog), NULL);
640}
GtkTextBuffer * qmbuffer[MAXDATAQM+2]
Definition calc.c:70
GtkWidget * qm_assistant
Definition calc.c:66
project * qm_proj
Definition calc.c:67
Variable declarations for the MD input preparation assistants.
integer(kind=c_int) function chemistry()
Definition chemistry.F90:22
GtkWidget * cpmd_box(GtkWidget *box, gchar *lab, int v_space, int h_space, int dim)
prepare a labelled box widget for the CPMD input creation assistant
Definition cpmd_init.c:244
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
Variable declarations for the creation of the CPMD input file.
gchar * default_text[9][NDFT]
Definition cpmd_init.c:150
#define DEFDU
Definition cpmd.h:51
cpmd * tmp_cpmd
Definition cpmd_init.c:103
int defaut_num[9]
Definition cpmd_init.c:138
gchar * default_opts[MAXDATAQM-1][NSECOP]
Definition cpmd_init.c:123
#define DEFCO
Definition cpmd.h:49
GtkWidget * sel_but[3]
Definition cpmd_nose.c:137
void create_dummy_param_box(int dummy_id)
crreate dummy atom parameter widgets
Definition cpmd_atoms.c:144
dummy_atom * dummy
Definition cpmd_atoms.c:73
void dummy_set_visible(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
show / hide cell renderer in the CPMD dummy atom(s) tree store
Definition cpmd_atoms.c:302
void create_selection_button(GtkWidget *box, int num, int id, gpointer data)
create thermostat atom(s) selection button
Definition cpmd_nose.c:1433
GtkWidget * dummy_box[2]
Definition cpmd_atoms.c:70
G_MODULE_EXPORT void dummy_type_changed(GtkComboBox *box, gpointer data)
change the dummy atom type
Definition cpmd_atoms.c:125
GtkWidget * create_dummy_box()
create the dummy atom(s) widgets
Definition cpmd_atoms.c:579
int n_dummy
Definition cpmd_atoms.c:74
int * old_dummy
Definition cpmd_atoms.c:75
void create_selection_combo(int id, int num, int type, GCallback handler)
create thermostat selection combo box
Definition cpmd_nose.c:1506
GtkWidget * dummy_param_box
Definition cpmd_atoms.c:72
void clean_dummy_widgets()
destroy dummy atom(s) widgets
Definition cpmd_atoms.c:334
int num_cpmd_objects
Definition cpmd_nose.c:154
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
void print_the_section(int s, int p, GtkTextBuffer *buffer)
print CPMD input section
Definition cpmd_print.c:697
G_MODULE_EXPORT void select_dummy(GtkCellRendererToggle *cell_renderer, gchar *string_path, gpointer data)
on select dummy atom toggle callback
Definition cpmd_atoms.c:246
GtkWidget * combo_id_box[2]
Definition cpmd_nose.c:146
GtkWidget * combo_id[2]
Definition cpmd_nose.c:145
GtkWidget * the_dummy_box
Definition cpmd_atoms.c:71
void dummy_set_color(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color in the CPMD dummy atom(s) tree store
Definition cpmd_atoms.c:283
dummy_atom * init_dummy(int type, int id)
create dummy atom
Definition cpmd_atoms.c:223
dummy_atom * get_active_dummy(int id)
get dummy atom by id
Definition cpmd_atoms.c:86
void remove_dummy(int num_to_remove)
remove dummy atom(s) - creating the dialog
Definition cpmd_atoms.c:439
GtkCellRenderer * dummy_renderer[5]
Definition cpmd_atoms.c:76
G_MODULE_EXPORT void atom_button(GtkWidget *but, gpointer data)
CPMD input file, add constraint(s) or dummy atom(s) - creating the dialog.
Definition cpmd_atoms.c:603
GtkTreeViewColumn * dummy_col[5]
Definition cpmd_atoms.c:77
G_MODULE_EXPORT void changed_opt_box(GtkComboBox *box, gpointer data)
change CPMD QM option
Definition cpmd_init.c:366
void add_dummy(int extra)
add dummy atom(s)
Definition cpmd_atoms.c:511
G_MODULE_EXPORT void add_or_remove_dummy(GtkSpinButton *res, gpointer data)
add or remove dummy atom spin callback
Definition cpmd_atoms.c:542
G_MODULE_EXPORT void changed_dummy_id_box(GtkComboBox *box, gpointer data)
change the dummy atom id
Definition cpmd_atoms.c:208
G_MODULE_EXPORT void run_remove_dummy(GtkDialog *dialog, gint response_id, gpointer data)
remove dummy atom(s) - running the dialog
Definition cpmd_atoms.c:352
G_MODULE_EXPORT void update_dummy_coord(GtkEntry *res, gpointer data)
udate dummy atom coordinate entry callback
Definition cpmd_atoms.c:104
ColRGBA col
Definition d_measures.c:77
int atoms[NUM_STYLES][2]
GtkTreePath * path
Definition datab.c:103
GType col_type[MAXDATA][12]
Definition dlp_field.c:946
int * allocint(int val)
allocate an int * pointer
Definition global.c:301
#define i18n(String)
Definition global.c:80
double string_to_double(gpointer string)
convert string to double
Definition global.c:611
Global variable declarations Global convenience function declarations Global data structure defin...
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
Definition gtk-misc.c:533
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
Definition gtk-misc.c:935
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
Definition gtk-misc.c:1401
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
Definition gtk-misc.c:688
void set_renderer_color(int tocol, GtkCellRenderer *renderer, ColRGBA col)
set the color of a GtkCellRenderer
Definition gtk-misc.c:1740
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
Definition gtk-misc.c:2139
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
Definition gtk-misc.c:552
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
Definition gtk-misc.c:958
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
Definition gtk-misc.c:652
#define BSEP
Definition global.h:261
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:1877
@ CONTAINER_SCR
Definition global.h:267
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
Definition gtk-misc.c:1010
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
Definition gtk-misc.c:861
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
create a GtkLabel with pango markup
Definition gtk-misc.c:1672
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:340
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:247
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
Definition gtk-misc.c:2235
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:849
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
Definition gtk-misc.c:987
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:2272
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2213
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
Definition gtk-misc.c:267
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Definition gtk-misc.c:837
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:202
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void show_warning(char *warning, GtkWidget *win)
show warning
Definition interface.c:266
gboolean ask_yes_no(gchar *title, gchar *text, int type, GtkWidget *widg)
ask yes or no for something: prepare dialog
Definition interface.c:420
gchar * exact_name(gchar *name)
short cut to print string without spaces
Definition interface.c:434
Messaging function declarations.
Definition glwin.h:350
GtkWidget * res[2]
Definition w_encode.c:342
GtkWidget * hbox
Definition workspace.c:71
GtkWidget * vbox
Definition workspace.c:72