atomes 1.1.16
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
w_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-2024 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'w_atoms.c'
24*
25* Contains:
26*
27
28 - The functions to create the atom(s) / clone(s) advanced configuration window
29
30*
31* List of functions:
32
33 G_MODULE_EXPORT gboolean close_event_model (GtkWindow * widg, gpointer data);
34 G_MODULE_EXPORT gboolean close_event_model (GtkWidget * widg, GdkEvent * event, gpointer data);
35
36 void atoms_input_win (GtkWidget * win, project * this_proj, int nspec, int aoc, double * val);
37
38 G_MODULE_EXPORT void update_atom_size (GtkEntry * res, gpointer data);
39 G_MODULE_EXPORT void set_atom_parameter (GtkWidget * widg, gpointer data);
40 G_MODULE_EXPORT void set_atom_color (GtkColorChooser * colob, gpointer data);
41 G_MODULE_EXPORT void toggled_show_hide_atom (GtkCheckButton * but, gpointer data);
42 G_MODULE_EXPORT void toggled_show_hide_atom (GtkToggleButton * but, gpointer data);
43 G_MODULE_EXPORT void toggled_show_hide_label (GtkCheckButton * but, gpointer data);
44 G_MODULE_EXPORT void toggled_show_hide_label (GtkToggleButton * but, gpointer data);
45 G_MODULE_EXPORT void close_model (GtkButton * but, gpointer data);
46 G_MODULE_EXPORT void atom_properties (GtkWidget * widg, gpointer data);
47 G_MODULE_EXPORT void atom_properties (GSimpleAction * action, GVariant * parameter, gpointer data);
48
49 GtkWidget * prop_tab (glwin * view, int aoc);
50 GtkWidget * advance_atom_notebook (glwin * view, int atom_or_clone);
51 GtkWidget * advanced_atom_properties (int atom_or_clone, glwin * view);
52
53*/
54
55#include "global.h"
56#include "interface.h"
57#include "glview.h"
58#include "glwindow.h"
59#include "color_box.h"
60
61extern atom_search * allocate_atom_search (int proj, int action, int searchid, int tsize);
62extern gchar * label_atpts (project * this_proj, glwin * view, int id);
63extern GtkWidget * labels_tab (glwin * view, int id);
64extern GtkWidget * selection_tab (atom_search * asearch, int nats);
65extern GtkTreeStore * atom_model;
66
75G_MODULE_EXPORT void update_atom_size (GtkEntry * res, gpointer data)
76{
77 int j;
78 gchar * str;
79 tint * the_data = (tint *)data;
80 int a, t;
81 a = the_data -> c;
82 project * this_proj = get_project_by_id (the_data -> a);
83 j = this_proj -> modelgl -> anim -> last -> img -> style;
84 const gchar * m = entry_get_text (res);
85 double v = string_to_double ((gpointer)m);
86 int s = this_proj -> nspec;
87 if (j == WIREFRAME || j == PUNT)
88 {
89 if (v > 0.0)
90 {
91 this_proj -> modelgl -> anim -> last -> img -> pointrad[a] = v;
92 int shaders[2] = {ATOMS, SELEC};
93 re_create_md_shaders (2, shaders, this_proj);
94 this_proj -> modelgl -> create_shaders[PICKS] = TRUE;
95 this_proj -> modelgl -> create_shaders[LABEL] = TRUE;
96 }
97 v = this_proj -> modelgl -> anim -> last -> img -> pointrad[a];
98 t = PUNT;
99 }
100 else
101 {
102 if (v > 0.0)
103 {
104 this_proj -> modelgl -> anim -> last -> img -> sphererad[a] = v;
105 int shaders[2] = {ATOMS, SELEC};
106 re_create_md_shaders (2, shaders, this_proj);
107 this_proj -> modelgl -> create_shaders[PICKS] = TRUE;
108 this_proj -> modelgl -> create_shaders[LABEL] = TRUE;
109 }
110 v = this_proj -> modelgl -> anim -> last -> img -> sphererad[a];
111 t = SPHERES;
112 }
114 if (a < s)
115 {
116 str = label_atpts (this_proj, this_proj -> modelgl, t/PUNT);
117#ifdef GTK3
118 gtk_menu_item_set_label (GTK_MENU_ITEM(this_proj -> modelgl -> ogl_atoms[t-2]), str);
119#endif
120 }
121 else
122 {
123 str = label_atpts (opengl_project, opengl_project -> modelgl, 2+t/PUNT);
124#ifdef GTK3
125 gtk_menu_item_set_label (GTK_MENU_ITEM(opengl_project -> modelgl -> ogl_atoms[t+2]), str);
126#endif
127 }
128 g_free (str);
129 update (this_proj -> modelgl);
130}
131
143void atoms_input_win (GtkWidget * win, project * this_proj, int nspec, int aoc, double * val)
144{
145 int i, j, k;
146 GtkWidget * vbox = dialog_get_content_area (win);
147 GtkWidget * hbo;
148 GtkWidget * rad;
149 gchar * dim[2]={" pts"," Å "};
150 gchar * str;
151 if (this_proj -> modelgl -> anim -> last -> img -> style == WIREFRAME || this_proj -> modelgl -> anim -> last -> img -> style == PUNT)
152 {
153 k = 0;
154 }
155 else
156 {
157 k = 1;
158 }
159 for (i=0; i<nspec; i++)
160 {
161 hbo = create_hbox (0);
162 gtk_widget_set_size_request (hbo, 250, -1);
163 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbo, TRUE, TRUE, 0);
164 if (aoc == 0)
165 {
166 str = g_strdup_printf (" %s", this_proj -> chemistry -> label[i]);
167 }
168 else
169 {
170 str = g_strdup_printf (" %s*", this_proj -> chemistry -> label[i]);
171 }
172 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbo, markup_label(str, 100, -1, 0.2, 0.5), FALSE, FALSE, 0);
173 g_free (str);
174 j = i + aoc*nspec;
175 rad = create_entry (G_CALLBACK(update_atom_size), 120, 15, FALSE, (gpointer)& this_proj -> modelgl -> colorp[0][j]);
176 update_entry_double (GTK_ENTRY(rad), val[j]);
177 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbo, rad, FALSE, FALSE, 0);
178 if (this_proj -> modelgl -> anim -> last -> img -> style == SPACEFILL) widget_set_sensitive (rad, 0);
179 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbo, markup_label(dim[k], 30, -1, 0.0, 0.5), FALSE, FALSE, 0);
180 }
182}
183
192G_MODULE_EXPORT void set_atom_parameter (GtkWidget * widg, gpointer data)
193{
194 tint * the_data = (tint *)data;
195 gchar * title[2][2] = {{"Adjust atom sphere radius", "Adjust clone sphere radius"},
196 {"Adjust atom point size", "Adjust clone point size"}};
197
198 opengl_project_changed (the_data -> a);
199 int s = opengl_project -> nspec;
200 double * val;
201 int id = the_data -> b;
202 int jd = the_data -> c;
203 if (jd)
204 {
205 val = opengl_project -> modelgl -> anim -> last -> img -> pointrad;
206 }
207 else if (opengl_project -> modelgl -> anim -> last -> img -> style == SPACEFILL)
208 {
209 val = opengl_project -> modelgl -> anim -> last -> img -> atomicrad;
210 }
211 else
212 {
213 val = opengl_project -> modelgl -> anim -> last -> img -> sphererad;
214 }
215 GtkWidget * win = dialogmodal (title[jd][id], GTK_WINDOW(opengl_project -> modelgl -> win));
216 atoms_input_win (win, opengl_project, s, id, val);
217 run_this_gtk_dialog (win, G_CALLBACK(run_destroy_dialog), NULL);
218}
219
228G_MODULE_EXPORT void set_atom_color (GtkColorChooser * colob, gpointer data)
229{
230 tint * the_data = (tint *)data;
231 int a;
232 project * this_proj = get_project_by_id(the_data -> a);
233 a = the_data -> c;
234 this_proj -> modelgl -> anim -> last -> img -> at_color[a] = get_button_color (colob);
235 int shaders[2] = {ATOMS, BONDS};
236 re_create_md_shaders (2, shaders, this_proj);
237 update (this_proj -> modelgl);
238}
239
240#ifdef GTK4
249G_MODULE_EXPORT void toggled_show_hide_atom (GtkCheckButton * but, gpointer data)
250#else
259G_MODULE_EXPORT void toggled_show_hide_atom (GtkToggleButton * but, gpointer data)
260#endif
261{
262 tint * id = (tint *)data;
263 int i, j, k;
264 i = id -> a;
265 j = id -> b;
266 k = id -> c;
267 gboolean show;
268#ifdef GTK4
269 project * this_proj = get_project_by_id (i);
270 int l, m;
271 show = gtk_check_button_get_active (but);
272 for (l=0; l<this_proj -> steps; l++)
273 {
274 for (m=0; m<this_proj -> natomes; m++)
275 {
276 if (this_proj -> atoms[l][m].sp == k)
277 {
278 this_proj -> atoms[l][m].show[j] = show;
279 }
280 }
281 }
282 this_proj -> modelgl -> anim -> last -> img -> show_atom[j][k] = show;
283 init_default_shaders (this_proj -> modelgl);
284 update_menu_bar (this_proj -> modelgl);
285#else
286 show = gtk_toggle_button_get_active (but);
287 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)get_project_by_id(i) -> modelgl -> ogl_spec[j][k], show);
288#endif
289}
290
291#ifdef GTK4
300G_MODULE_EXPORT void toggled_show_hide_label (GtkCheckButton * but, gpointer data)
301#else
310G_MODULE_EXPORT void toggled_show_hide_label (GtkToggleButton * but, gpointer data)
311#endif
312{
313 tint * id = (tint *)data;
314 int i, j, k;
315 i = id -> a;
316 j = id -> b;
317 k = id -> c;
318 gboolean show;
319 project * this_proj = get_project_by_id (i);
320#ifdef GTK4
321 int l, m;
322 show = gtk_check_button_get_active (but);
323 for (l=0; l<this_proj -> steps; l++)
324 {
325 for (m=0; m<this_proj -> natomes; m++)
326 {
327 if (this_proj -> atoms[l][m].sp == k)
328 {
329 this_proj -> atoms[l][m].label[j] = show;
330 }
331 }
332 }
333 this_proj -> modelgl -> labelled = check_label_numbers (this_proj, j);
334 this_proj -> modelgl -> create_shaders[LABEL] = TRUE;
335 update (this_proj -> modelgl);
336 update_menu_bar (this_proj -> modelgl);
337#else
338 // GTK3 Menu Action To Check
339 show = gtk_toggle_button_get_active (but);
340 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_lab[j][k], show);
341#endif
342}
343
352GtkWidget * prop_tab (glwin * view, int aoc)
353{
354 int i, j, k;
355 gchar * str;
356 GtkWidget * lab;
357 GtkWidget * prop_box;
358 GtkWidget * hbox;
359 GtkWidget * but;
360 GtkWidget * entry;
361 project * this_proj = get_project_by_id(view -> proj);
362 gchar * col[5] = {"<b>Color</b>",
363 "<b>Radius [Å]</b>",
364 "<b>Show</b>",
365 "<b>Label</b>",
366 "<b>Size [pts]</b>"};
367 int csize[5] = {60, 0, 25, 0, 0};
368
369 GtkWidget * prop = create_layout (-1, -1);
370 GtkWidget * vbox = add_vbox_to_layout (prop, -1, -1);
371
372 k = view -> anim -> last -> img -> style;
373 prop_box = create_hbox (0);
374 gtk_widget_set_size_request (prop_box, -1, -1);
375 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, prop_box, FALSE, TRUE, 0);
376 for (i=0; i<4; i++)
377 {
378 if (i == 1 && (k == WIREFRAME || k == PUNT))
379 {
380 lab = markup_label(col[4], -1, -1, 0.0, 0.0);
381 }
382 else
383 {
384 lab = markup_label (col[i], -1, -1, 0.0, 0.0);
385 }
386 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, prop_box, lab, FALSE, FALSE, csize[i]);
387 }
388 for (i=0; i< this_proj -> nspec; i++)
389 {
390 hbox = create_hbox (0);
391 //gtk_widget_set_size_request (hbox, -1, -1);
392 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, TRUE, 0);
393 j = i + aoc * this_proj -> nspec;
394 if (aoc == 0)
395 {
396 str = g_strdup_printf (" <b>%s</b>", this_proj -> chemistry -> label[i]);
397 }
398 else
399 {
400 str = g_strdup_printf (" <b>%s<sup>*</sup></b>", this_proj -> chemistry -> label[i]);
401 }
402 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(str, 30, -1, 0.0, 0.5), FALSE, FALSE, 10);
403 g_free (str);
404
405 but = color_button (view -> anim -> last -> img -> at_color[j], TRUE, 80, -1, G_CALLBACK(set_atom_color), & view -> colorp[0][j]);
406 if (aoc == 0)
407 {
408 str = g_strdup_printf ("%s atom(s) color", this_proj -> chemistry -> label[i]);
409 }
410 else
411 {
412 str = g_strdup_printf ("%s clone(s) color", this_proj -> chemistry -> label[i]);
413 }
414 gtk_color_button_set_title (GTK_COLOR_BUTTON(but), str);
415 g_free (str);
416 if (this_proj -> modelgl -> anim -> last -> img -> color_map[0] != 0)
417 {
418 widget_set_sensitive (but, 0);
419 }
420 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, but, FALSE, FALSE, 5);
421
422 // Raduis entry
423 entry = create_entry (G_CALLBACK(update_atom_size), 80, 10, FALSE, (gpointer)& this_proj -> modelgl -> colorp[0][j]);
424 if (k == WIREFRAME || k == PUNT)
425 {
426 update_entry_double (GTK_ENTRY(entry), view -> anim -> last -> img -> pointrad[j]);
427 }
428 else if (k == BALL_AND_STICK || k == SPHERES)
429 {
430 update_entry_double (GTK_ENTRY(entry), view -> anim -> last -> img -> sphererad[j]);
431 }
432 else if (k == SPACEFILL)
433 {
434 update_entry_double (GTK_ENTRY(entry), view -> anim -> last -> img -> atomicrad[j]);
435 widget_set_sensitive (entry, 0);
436 }
437 else
438 {
439 if (k == CYLINDERS)
440 {
441 update_entry_double (GTK_ENTRY(entry), view -> anim -> last -> img -> radall[aoc]);
442 }
443 widget_set_sensitive (entry, 0);
444 }
445 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 0);
446
447 // Show/Hide check button
448 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button (NULL, -1, -1, view -> anim -> last -> img -> show_atom[aoc][i], G_CALLBACK(toggled_show_hide_atom), & view -> colorp[aoc][i]), FALSE, FALSE, 30);
449 // Show/Hide label check button
450 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button (NULL, -1, -1, view -> anim -> last -> img -> show_label[aoc][i], G_CALLBACK(toggled_show_hide_label), & view -> colorp[aoc][i]), FALSE, FALSE, 5);
451 }
452 return prop;
453}
454
463G_MODULE_EXPORT void close_model (GtkButton * but, gpointer data)
464{
465 tint * dat = (tint *)data;
466 project * this_proj = get_project_by_id(dat -> a);
467 this_proj -> modelgl -> model_win[dat -> b] -> win = destroy_this_widget (this_proj -> modelgl -> model_win[dat -> b] -> win);
468 g_free (this_proj -> modelgl -> model_win[dat -> b]);
469 this_proj -> modelgl -> model_win[dat -> b] = NULL;
470 g_free (this_proj -> modelgl -> search_widg[dat -> b]);
471 this_proj -> modelgl -> search_widg[dat -> b] = NULL;
472}
473
474#ifdef GTK4
483G_MODULE_EXPORT gboolean close_event_model (GtkWindow * widg, gpointer data)
484#else
494G_MODULE_EXPORT gboolean close_event_model (GtkWidget * widg, GdkEvent * event, gpointer data)
495#endif
496{
497 close_model (NULL, data);
498 return FALSE;
499}
500
509GtkWidget * advance_atom_notebook (glwin * view, int atom_or_clone)
510{
511 GtkWidget * notebook = gtk_notebook_new ();
512 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), prop_tab (view, atom_or_clone), gtk_label_new ("Display properties"));
513 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), labels_tab (view, atom_or_clone), gtk_label_new ("Label properties"));
514
515 if (view -> search_widg[atom_or_clone] == NULL)
516 {
517 view -> search_widg[atom_or_clone] = allocate_atom_search (view -> proj, atom_or_clone, atom_or_clone, get_project_by_id(view -> proj) -> natomes);
518 }
519 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
520 selection_tab (view -> search_widg[atom_or_clone], get_project_by_id(view -> proj) -> natomes),
521 gtk_label_new ((atom_or_clone) ? "Clone(s) selection" : "Atom(s) selection"));
522 return notebook;
523}
524
533GtkWidget * advanced_atom_properties (int atom_or_clone, glwin * view)
534{
535 GtkWidget * aprop;
536 gchar * win_title[2]={"Atom(s) configuration - ", "Clone(s) configuration - "};
537 gchar * str = g_strdup_printf ("%s%s", win_title[atom_or_clone], prepare_for_title(get_project_by_id(view -> proj)->name));
538 aprop = create_win (str, view -> win, FALSE, FALSE);
539 int i = (get_project_by_id(view -> proj)-> natomes > 10000) ? 170 : 0;
540 gtk_widget_set_size_request (aprop, -1, 580+i);
541 GtkWidget * vbox = create_vbox (5);
543 view -> model_win[atom_or_clone] -> notebook = advance_atom_notebook (view, atom_or_clone);
544 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, view -> model_win[atom_or_clone] -> notebook, TRUE, TRUE, 0);
545 GtkWidget * hbox = create_hbox (5);
546 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 5);
547 GtkWidget * but = create_button ("Close", IMG_STOCK, FCLOSE, -1, -1, GTK_RELIEF_NORMAL, G_CALLBACK(close_model), & view -> colorp[atom_or_clone][0]);
548 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, but, FALSE, FALSE, 5);
549 add_gtk_close_event (aprop, G_CALLBACK(close_event_model), & view -> colorp[atom_or_clone][0]);
550 return aprop;
551}
552
553#ifdef GTK3
562G_MODULE_EXPORT void atom_properties (GtkWidget * widg, gpointer data)
563#else
573G_MODULE_EXPORT void atom_properties (GSimpleAction * action, GVariant * parameter, gpointer data)
574#endif
575{
576 tint * the_data = (tint *) data;
577 int atom_or_clone = the_data -> b;
578 project * this_proj = get_project_by_id (the_data -> a);
579 if (this_proj -> modelgl -> model_win[atom_or_clone] == NULL)
580 {
581 this_proj -> modelgl -> model_win[atom_or_clone] = g_malloc0 (sizeof*this_proj -> modelgl -> model_win[atom_or_clone]);
582 this_proj -> modelgl -> model_win[atom_or_clone] -> win = advanced_atom_properties (atom_or_clone, this_proj -> modelgl);
583 show_the_widgets (this_proj -> modelgl -> model_win[atom_or_clone] -> win);
584 if (this_proj -> natomes < 10000)
585 {
586 hide_the_widgets (this_proj -> modelgl -> search_widg[atom_or_clone] -> info[1]);
587 }
588 else
589 {
590 hide_the_widgets (this_proj -> modelgl -> search_widg[atom_or_clone] -> id_box);
591 }
592 }
593 if (GTK_IS_WIDGET(this_proj -> modelgl -> model_win[atom_or_clone] -> win))
594 {
595 gtk_notebook_set_current_page (GTK_NOTEBOOK (this_proj -> modelgl -> model_win[atom_or_clone] -> notebook), the_data -> c);
596 }
597 else
598 {
599 show_warning (g_strdup_printf ("Error impossible to display the model window for %s !", (atom_or_clone) ? "clones" : "atomes"), this_proj -> modelgl -> win);
600 }
601}
integer(kind=c_int) function chemistry()
Definition chemistry.F90:22
Structure definitions for color management Function declarations for color management.
color colorp[64]
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
int atoms[NUM_STYLES][2]
float val
Definition dlp_init.c:117
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
double string_to_double(gpointer string)
convert string to double
Definition global.c:624
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:492
@ IMG_STOCK
Definition global.h:264
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
Definition gtk-misc.c:1314
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
Definition gtk-misc.c:633
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
Definition gtk-misc.c:510
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
Definition gtk-misc.c:445
project * proj
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:864
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
Definition gtk-misc.c:597
void opengl_project_changed(int id)
change the OpenGL project
Definition update_p.c:245
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:2387
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
Definition gtk-misc.c:1799
@ CONTAINER_WIN
Definition global.h:250
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:1863
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
Definition gtk-misc.c:825
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
Definition gtk-misc.c:1585
project * opengl_project
Definition project.c:54
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:299
ColRGBA get_button_color(GtkColorChooser *colob)
get the ColRGBA color from a GtkColorChooser button
Definition gtk-misc.c:2236
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:206
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:813
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:2102
GtkWidget * create_layout(int x, int y)
create a GtkLayout / GtkFixed widget
Definition gtk-misc.c:880
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2034
GtkWidget * color_button(ColRGBA col, gboolean alpha, int dimx, int dimy, GCallback handler, gpointer data)
create a color selection button
Definition gtk-misc.c:1728
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
Definition tools.c:71
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
Definition gtk-misc.c:226
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
Definition gtk-misc.c:189
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Definition gtk-misc.c:801
#define FCLOSE
Definition global.h:211
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:173
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
void update(glwin *view)
update the rendering of the OpenGL window
Definition glview.c:439
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void re_create_md_shaders(int nshaders, int shaders[nshaders], project *this_proj)
re-initialize some MD dependent OpenGL shaders
action
Definition glview.h:189
int check_label_numbers(project *this_proj, int types)
check how many atom label(s) are visible
Definition popup.c:1040
@ SPHERES
Definition glview.h:176
@ SPACEFILL
Definition glview.h:175
@ BALL_AND_STICK
Definition glview.h:173
@ CYLINDERS
Definition glview.h:177
@ WIREFRAME
Definition glview.h:174
@ PUNT
Definition glview.h:178
shaders
The different types of shaders in the atomes program.
Definition glwin.h:88
@ BONDS
Definition glwin.h:90
@ PICKS
Definition glwin.h:97
@ LABEL
Definition glwin.h:98
@ SELEC
Definition glwin.h:91
@ ATOMS
Definition glwin.h:89
Function declarations for the creation of the OpenGL window.
void show_warning(char *warning, GtkWidget *win)
show warning
Definition interface.c:260
Messaging function declarations.
Definition glwin.h:875
Definition global.h:104
int b
Definition tab-1.c:95
int c
Definition tab-1.c:95
int a
Definition tab-1.c:95
G_MODULE_EXPORT void atom_properties(GSimpleAction *action, GVariant *parameter, gpointer data)
atom(s) propery callback GTK4
Definition w_atoms.c:573
GtkWidget * labels_tab(glwin *view, int id)
create atomic label(s) tab for the atom(s) / clone(s) window
Definition w_labels.c:537
gchar * label_atpts(project *this_proj, glwin *view, int id)
prepare the text of a menu item in the 'Model -> Atom(s)' submenu
Definition m_atoms.c:72
G_MODULE_EXPORT void set_atom_color(GtkColorChooser *colob, gpointer data)
set atom color callback
Definition w_atoms.c:228
GtkWidget * selection_tab(atom_search *asearch, int nats)
create the search widget
Definition w_search.c:4130
GtkWidget * advance_atom_notebook(glwin *view, int atom_or_clone)
create atom(s) advanced properties notebook
Definition w_atoms.c:509
G_MODULE_EXPORT void toggled_show_hide_atom(GtkToggleButton *but, gpointer data)
toggle show/hide atom(s) callback GTK3
Definition w_atoms.c:259
G_MODULE_EXPORT void update_atom_size(GtkEntry *res, gpointer data)
update atom radius callback
Definition w_atoms.c:75
atom_search * allocate_atom_search(int proj, int action, int searchid, int tsize)
allocate atom search data structure
Definition atom_edit.c:392
G_MODULE_EXPORT gboolean close_event_model(GtkWidget *widg, GdkEvent *event, gpointer data)
close event callback GTK3
Definition w_atoms.c:494
GtkTreeStore * atom_model
GtkWidget * advanced_atom_properties(int atom_or_clone, glwin *view)
create atom advanced properties window 'model_win'
Definition w_atoms.c:533
void atoms_input_win(GtkWidget *win, project *this_proj, int nspec, int aoc, double *val)
prepare atom radii entry list
Definition w_atoms.c:143
G_MODULE_EXPORT void toggled_show_hide_label(GtkToggleButton *but, gpointer data)
toggle show/hide label(s) callback GTK3
Definition w_atoms.c:310
G_MODULE_EXPORT void set_atom_parameter(GtkWidget *widg, gpointer data)
set atom parameter - creating the dialog
Definition w_atoms.c:192
G_MODULE_EXPORT void close_model(GtkButton *but, gpointer data)
free 'model_win' data
Definition w_atoms.c:463
GtkWidget * prop_tab(glwin *view, int aoc)
create atom(s)/clone(s) properties tab
Definition w_atoms.c:352
GtkWidget * res[2]
Definition w_encode.c:212
GtkWidget * hbox
Definition workspace.c:71
GtkWidget * img
Definition workspace.c:70
GtkWidget * vbox
Definition workspace.c:72
GtkWidget * lab
Definition workspace.c:73