atomes 1.2.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
w_colors.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-2025 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'w_colors.c'
24*
25* Contains:
26*
27
28 - The functions to create the color selection dialogs
29
30*
31* List of functions:
32
33 void update_gradient_widgets (gradient_edition * gradient_win, background * back);
34 void window_color (project * this_proj, glwin * view);
35 void back_position_has_changed (gpointer data, GLfloat v);
36
37 G_MODULE_EXPORT void run_window_color (GtkDialog * win, gint response_id, gpointer data);
38 G_MODULE_EXPORT void to_run_back_color_window (GSimpleAction * action, GVariant * parameter, gpointer data);
39 G_MODULE_EXPORT void to_run_back_color_window (GtkWidget * widg, gpointer data);
40 G_MODULE_EXPORT void to_run_box_color_window (GSimpleAction * action, GVariant * parameter, gpointer data);
41 G_MODULE_EXPORT void to_run_box_color_window (GtkWidget * widg, gpointer data);
42 G_MODULE_EXPORT void to_run_atom_color_window (GSimpleAction * action, GVariant * parameter, gpointer data);
43 G_MODULE_EXPORT void to_run_atom_color_window (GtkWidget * widg, gpointer data);
44 G_MODULE_EXPORT void run_window_color_coord (GtkDialog * win, gint response_id, gpointer data);
45 G_MODULE_EXPORT void window_color_coord (GSimpleAction * action, GVariant * parameter, gpointer data);
46 G_MODULE_EXPORT void window_color_coord (GtkWidget * widg, gpointer data);
47
48 G_MODULE_EXPORT void set_gradient_parameter (GtkWidget * widg, gpointer data);
49 G_MODULE_EXPORT void set_gradient_color (GtkColorChooser * colob, gpointer data);
50 G_MODULE_EXPORT void set_back_position (GtkRange * range, gpointer data);
51 G_MODULE_EXPORT void gradient_advanced (GtkWidget * widg, gpointer data);
52
53 G_MODULE_EXPORT gboolean scroll_set_back_position (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data);
54 G_MODULE_EXPORT gboolean on_gradient_delete (GtkWindow * widg, gpointer data);
55 G_MODULE_EXPORT gboolean on_gradient_delete (GtkWidget * widg, GdkEvent * event, gpointer data);
56
57*/
58
59#include "global.h"
60#include "interface.h"
61#include "project.h"
62#include "glwindow.h"
63#include "glview.h"
64#include "color_box.h"
65#include "preferences.h"
66
67/*
68 The object type for color change
69 -2 : background
70 -1 : box
71 > -1 : coordination
72*/
74
75
85{
86 combo_set_active (gradient_win -> g_box, back -> gradient);
87 int i;
88 GdkRGBA col = colrgba_togtkrgba (back -> color);
89 gtk_color_chooser_set_rgba ((GtkColorChooser *)gradient_win -> col_but, & col);
90 for (i=0; i<2; i++)
91 {
92 col = colrgba_togtkrgba (back -> gradient_color[i]);
93 gtk_color_chooser_set_rgba ((GtkColorChooser *)gradient_win -> grad_but[i], & col);
94 }
95 combo_set_active (gradient_win -> g_box, back -> gradient);
96 if (back -> gradient)
97 {
98 show_the_widgets (gradient_win -> dir);
99 hide_the_widgets (gradient_win -> color_box[0]);
100 show_the_widgets (gradient_win -> color_box[1]);
101 hide_the_widgets (gradient_win -> d_box[(back -> gradient == 2) ? 0 : 1]);
102 show_the_widgets (gradient_win -> d_box[back -> gradient - 1]);
103 combo_set_active (gradient_win -> d_box[back -> gradient - 1], back -> direction);
104 show_the_widgets (gradient_win -> p_box);
105 }
106 else
107 {
108 hide_the_widgets (gradient_win -> dir);
109 show_the_widgets (gradient_win -> color_box[0]);
110 hide_the_widgets (gradient_win -> color_box[1]);
111 for (i=0; i<2; i++) hide_the_widgets (gradient_win -> d_box[i]);
112 hide_the_widgets (gradient_win -> p_box);
113 }
114}
115
125G_MODULE_EXPORT void run_window_color (GtkDialog * win, gint response_id, gpointer data)
126{
127 project * this_proj = (project *)data;
128
129 if (response_id == GTK_RESPONSE_OK)
130 {
131 ColRGBA colo = get_window_color (GTK_WIDGET(win));
132 if (wc_cid == -2)
133 {
134 this_proj -> modelgl -> anim -> last -> img -> back -> color = colo;
135 this_proj -> modelgl -> anim -> last -> img -> back -> gradient = 0;
136 cleaning_shaders (this_proj -> modelgl, BACKG);
137 this_proj -> modelgl -> create_shaders[MEASU] = TRUE;
138 if (this_proj -> modelgl -> gradient_win)
139 {
140 update_gradient_widgets (this_proj -> modelgl -> gradient_win, this_proj -> modelgl -> anim -> last -> img -> back);
141 }
142 }
143 else if (wc_cid == -1)
144 {
145 this_proj -> modelgl -> anim -> last -> img -> abc -> color = colo;
146 this_proj -> modelgl -> create_shaders[MDBOX] = TRUE;
147 }
148 else
149 {
150 this_proj -> modelgl -> anim -> last -> img -> at_color[wc_cid] = colo;
151 int shaders[2] = {ATOMS, BONDS};
152 re_create_md_shaders (2, shaders, this_proj);
153 int shader[1] = {POLYS};
154 if (this_proj -> modelgl -> anim -> last -> img -> color_map[1] == 0) re_create_md_shaders (1, shader, this_proj);
155 }
156 update (this_proj -> modelgl);
157 }
159}
160
169void window_color (project * this_proj, glwin * view)
170{
171 gchar * str;
172 GdkRGBA col;
173 if (wc_cid == -2)
174 {
175 str = g_strdup_printf ("Background color");
176 col = colrgba_togtkrgba (view -> anim -> last -> img -> back -> color);
177 }
178 else if (wc_cid == -1)
179 {
180 str = g_strdup_printf ("Model box color");
181 col = colrgba_togtkrgba (view -> anim -> last -> img -> abc -> color);
182 }
183 else
184 {
185 if (wc_cid < this_proj -> nspec)
186 {
187 str = g_strdup_printf ("%s - atom(s) color", this_proj -> chemistry -> label[wc_cid]);
188 }
189 else
190 {
191 str = g_strdup_printf ("%s* - clone(s) color", this_proj -> chemistry -> label[wc_cid-this_proj -> nspec]);
192 }
193 col = colrgba_togtkrgba (view -> anim -> last -> img -> at_color[wc_cid]);
194 }
195 GtkWidget * win = gtk_color_chooser_dialog_new (str, GTK_WINDOW(view -> win));
196 gtk_window_set_modal (GTK_WINDOW(win), TRUE);
197 gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER(win), TRUE);
198 gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER(win), & col);
199 g_free (str);
200 run_this_gtk_dialog (win, G_CALLBACK(run_window_color), this_proj);
201}
202
203#ifdef GTK4
213G_MODULE_EXPORT void to_run_back_color_window (GSimpleAction * action, GVariant * parameter, gpointer data)
214#else
223G_MODULE_EXPORT void to_run_back_color_window (GtkWidget * widg, gpointer data)
224#endif
225{
226 glwin * view = (glwin *) data;
227 wc_cid = -2;
228 window_color (get_project_by_id(view -> proj), view);
229 update (view);
230}
231
240G_MODULE_EXPORT void set_gradient_color (GtkColorChooser * colob, gpointer data)
241{
242 tint * bid = (tint *)data;
243 glwin * view;
244 if (preferences)
245 {
246 switch (bid -> b)
247 {
248 case 0:
250 break;
251 default:
252 tmp_background -> gradient_color[bid -> b -1] = get_button_color (colob);
253 break;
254 }
255 }
256 else
257 {
258 view = get_project_by_id(bid -> a) -> modelgl;
259 switch (bid -> b)
260 {
261 case 0:
262 view -> anim -> last -> img -> back -> color = get_button_color (colob);
263 break;
264 default:
265 view -> anim -> last -> img -> back -> gradient_color[bid -> b -1] = get_button_color (colob);
266 break;
267 }
268 }
269 if (! preferences)
270 {
271 if (bid -> b)
272 {
273 view -> create_shaders[BACKG] = TRUE;
274 }
275 view -> create_shaders[MEASU] = TRUE;
276 update (view);
277 }
278}
279
288G_MODULE_EXPORT void set_gradient_parameter (GtkWidget * widg, gpointer data)
289{
290 tint * bid = (tint *)data;
291 glwin * view;
292 gradient_edition * the_gradient;
293 background * the_back;
294 int i = combo_get_active (widg);
295 if (preferences)
296 {
297 the_gradient = pref_gradient_win;
298 the_back = tmp_background;
299 switch (bid -> b)
300 {
301 case 0:
302 tmp_background -> gradient = i;
303 tmp_background -> direction = 0;
304 break;
305 case 1:
306 tmp_background -> direction = i;
307 break;
308 }
309 }
310 else
311 {
312 view = get_project_by_id(bid -> a) -> modelgl;
313 the_gradient = view -> gradient_win;
314 the_back = view -> anim -> last -> img -> back;
315 switch (bid -> b)
316 {
317 case 0:
318 view -> anim -> last -> img -> back -> gradient = i;
319 view -> anim -> last -> img -> back -> direction = 0;
320 break;
321 default:
322 view -> anim -> last -> img -> back -> direction = i;
323 break;
324 }
325 }
326
327 update_gradient_widgets (the_gradient, the_back);
328 if (! preferences)
329 {
330 if (! bid -> b && ! i)
331 {
332 cleaning_shaders (view, BACKG);
333 }
334 else
335 {
336 view -> create_shaders[BACKG] = TRUE;
337 }
338 view -> create_shaders[MEASU] = TRUE;
339 update (view);
340 }
341}
342
351void back_position_has_changed (gpointer data, GLfloat v)
352{
353 tint * bid = (tint *)data;
354 if (preferences)
355 {
356 if (v >= 0.0 && v <= 1.0) tmp_background -> position = v;
357 }
358 else
359 {
360 glwin * view = get_project_by_id (bid -> a) -> modelgl;
361 if (v >= 0.0 && v <= 1.0) view -> anim -> last -> img -> back -> position = v;
362 view -> create_shaders[BACKG] = TRUE;
363 update (view);
364 }
365}
366
377G_MODULE_EXPORT gboolean scroll_set_back_position (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
378{
379 back_position_has_changed (data, (GLfloat) value);
380 return FALSE;
381}
382
391G_MODULE_EXPORT void set_back_position (GtkRange * range, gpointer data)
392{
393 back_position_has_changed (data, (GLfloat) gtk_range_get_value (range));
394}
395
396#ifdef GTK4
405G_MODULE_EXPORT gboolean on_gradient_delete (GtkWindow * widg, gpointer data)
406#else
416G_MODULE_EXPORT gboolean on_gradient_delete (GtkWidget * widg, GdkEvent * event, gpointer data)
417#endif
418{
419 glwin * view = (glwin *)data;
420 view -> gradient_win -> win = destroy_this_widget (view -> gradient_win -> win);
421 g_free (view -> gradient_win);
422 view -> gradient_win = NULL;
423 return TRUE;
424}
425
434G_MODULE_EXPORT void gradient_advanced (GtkWidget * widg, gpointer data)
435{
436 GtkWidget * hbox, * vbox;
437 GtkWidget * hhbox, * vvbox;
438 gradient_edition * the_gradient;
439 int back_gradient;
440 int back_direction;
441 float back_position;
442 ColRGBA back_color;
443 ColRGBA * gradient_color;
444 glwin * view;
446 if (preferences)
447 {
448 the_gradient = pref_gradient_win;
449 back_gradient = tmp_background -> gradient;
450 back_direction = tmp_background -> direction;
451 back_position = tmp_background -> position;
452 back_color = tmp_background -> color;
453 gradient_color = tmp_background -> gradient_color;
454 }
455 else
456 {
457 view = (glwin *)data;
458 view -> gradient_win = g_malloc0(sizeof*view -> gradient_win);
459 the_gradient = view -> gradient_win;
460 back_gradient = view -> anim -> last -> img -> back -> gradient;
461 back_direction = view -> anim -> last -> img -> back -> direction;
462 back_position = view -> anim -> last -> img -> back -> position;
463 back_color = view -> anim -> last -> img -> back -> color;
464 gradient_color = view -> anim -> last -> img -> back -> gradient_color;
465 }
466 if (preferences)
467 {
468 the_gradient -> win = create_vbox (BSEP);
469 adv_box (the_gradient -> win, "<b>Background settings</b>", 5, 120, 0.0);
471 add_box_child_start (GTK_ORIENTATION_VERTICAL, the_gradient -> win, hbox, FALSE, FALSE, 20);
472 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, vbox, FALSE, FALSE, 60);
473 }
474 else
475 {
476 gchar * str = g_strdup_printf ("%s - background settings", get_project_by_id(view -> proj)->name);
477 the_gradient -> win = create_win (str, view -> win, FALSE, FALSE);
478 g_free (str);
479 add_container_child (CONTAINER_WIN, the_gradient -> win, vbox);
480 }
481 int i, j;
482 gchar * g_name[2] = {"Gradient type", "Gradient direction"};
483 gchar * g_type[3] = {"No gradient", "Linear", "Circular"};
484 gchar * g_direction[2][9] = {{"Top to bottom", "Right to left", "Bottom right to top left", "Top right to bottom left", "", "", "", "", ""},
485 {"Right to left", "Left to right", "Top to bottom", "Bottom to top",
486 "Bottom right to top left", "Bottom left to top right", "Top right to bottom left", "Top left to bottom right", "Center"}};
487 int n_val[2] = {4, 9};
488 hbox = abox (vbox, g_name[0], 5);
489 the_gradient -> g_box = create_combo ();
490 for (i=0; i<3; i++)
491 {
492 combo_text_append (the_gradient -> g_box, g_type[i]);
493 }
494 combo_set_active (the_gradient -> g_box, back_gradient);
495 gtk_widget_set_size_request (the_gradient -> g_box, 200, -1);
496 g_signal_connect (G_OBJECT (the_gradient -> g_box), "changed", G_CALLBACK(set_gradient_parameter), (preferences) ? & pref_pointer[0] : & view -> colorp[0][0]);
497 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, the_gradient -> g_box, FALSE, FALSE, 20);
498
499 the_gradient -> dir = create_vbox (BSEP);
500 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, the_gradient -> dir, FALSE, FALSE, 0);
501
502 hbox = abox (the_gradient -> dir, g_name[1], 5);
503 for (i=0; i<2; i++)
504 {
505 the_gradient -> d_box[i] = create_combo ();
506 for (j=0; j<n_val[i]; j++)
507 {
508 combo_text_append (the_gradient -> d_box[i], g_direction[i][j]);
509 }
510 gtk_widget_set_size_request (the_gradient -> d_box[i], 200, -1);
511 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, the_gradient -> d_box[i], FALSE, FALSE, 20);
512 }
513 if (back_gradient)
514 {
515 combo_set_active (the_gradient -> d_box[back_gradient-1], back_direction);
516 }
517 for (i=0; i<2; i++)
518 {
519 g_signal_connect (G_OBJECT (the_gradient -> d_box[i]), "changed", G_CALLBACK(set_gradient_parameter), (preferences) ? & pref_pointer[1] : & view -> colorp[1][0]);
520 }
521 the_gradient -> color_box[0] = create_vbox (BSEP);
522 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, the_gradient -> color_box[0], FALSE, FALSE, 20);
523 abox (the_gradient -> color_box[0], "Background color", 5);
525 add_box_child_start (GTK_ORIENTATION_VERTICAL, the_gradient -> color_box[0], hbox, FALSE, FALSE, 5);
526 vvbox = create_vbox (BSEP);
527 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, vvbox, FALSE, FALSE, 60);
528 hhbox = create_hbox (BSEP);
529 add_box_child_start (GTK_ORIENTATION_VERTICAL, vvbox, hhbox, FALSE, FALSE, 0);
530 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, markup_label ("Single color", 150, -1, 0.0, 0.5), FALSE, FALSE, 5);
531 the_gradient -> col_but = color_button (back_color, FALSE, 100, -1, G_CALLBACK(set_gradient_color), (preferences) ? & pref_pointer[0] : & view -> colorp[0][0]);
532 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, the_gradient -> col_but, FALSE, FALSE, 0);
533
534 the_gradient -> color_box[1] = create_vbox (BSEP);
535 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, the_gradient -> color_box[1], FALSE, FALSE, 20);
536 abox (the_gradient -> color_box[1], "Gradient colors", 5);
538 add_box_child_start (GTK_ORIENTATION_VERTICAL, the_gradient -> color_box[1], hbox, FALSE, FALSE, 5);
539 vvbox = create_vbox (BSEP);
540 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, vvbox, FALSE, FALSE, 60);
541 gchar * c_name[2] = {"First color", "Second color"};
542 for (i=0; i<2; i++)
543 {
544 hhbox = create_hbox (BSEP);
545 // g_print ("col.r= %f, col.g= %f, col.b= %f\n", gradient_color[i].red, gradient_color[i].green, gradient_color[i].blue);
546 add_box_child_start (GTK_ORIENTATION_VERTICAL, vvbox, hhbox, FALSE, FALSE, 0);
547 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, markup_label (c_name[i], 150, -1, 0.0, 0.5), FALSE, FALSE, 5);
548 the_gradient -> grad_but[i] = color_button (gradient_color[i], FALSE, 100, -1, G_CALLBACK(set_gradient_color), (preferences) ? & pref_pointer[i+1] : & view -> colorp[i+1][0]);
549 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, the_gradient -> grad_but[i], FALSE, FALSE, 0);
550 }
551
552 the_gradient -> p_box = abox (the_gradient -> color_box[1], "Mixed position", 5);
553 the_gradient -> p_scale = create_hscale (0.0, 1.0, 0.001, back_position, GTK_POS_TOP, 3, 150, G_CALLBACK(set_back_position), G_CALLBACK(scroll_set_back_position), (preferences) ? & pref_pointer[0] : & view -> colorp[0][0]);
554 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, the_gradient -> p_box, the_gradient -> p_scale, FALSE, FALSE, 20);
555
556 if (! preferences)
557 {
558 add_global_option (vbox, & view -> colorp[3][0]);
559 add_gtk_close_event (the_gradient -> win, G_CALLBACK(on_gradient_delete), view);
560 show_the_widgets (the_gradient -> win);
561 update_gradient_widgets (the_gradient, view -> anim -> last -> img -> back);
562 }
563}
564
565#ifdef GTK4
575G_MODULE_EXPORT void to_run_box_color_window (GSimpleAction * action, GVariant * parameter, gpointer data)
576#else
585G_MODULE_EXPORT void to_run_box_color_window (GtkWidget * widg, gpointer data)
586#endif
587{
588 glwin * view = (glwin *) data;
589 wc_cid = -1;
590 window_color (get_project_by_id(view -> proj), view);
591 view -> create_shaders[MDBOX] = TRUE;
592 update (view);
593}
594
595#ifdef GTK4
605G_MODULE_EXPORT void to_run_atom_color_window (GSimpleAction * action, GVariant * parameter, gpointer data)
606#else
615G_MODULE_EXPORT void to_run_atom_color_window (GtkWidget * widg, gpointer data)
616#endif
617{
618 tint * id = (tint *) data;
619 // g_debug ("Atom color:: proj= %d, id -> b= %d, id -> c= %d", id -> a, id -> b, id -> c);
620 project * this_proj = get_project_by_id(id -> a);
621 wc_cid = id -> c;
622 window_color (this_proj, this_proj -> modelgl);
623 int shaders[3] = {ATOMS, BONDS, SELEC};
624 re_create_md_shaders (3, shaders, this_proj);
625 this_proj -> modelgl -> create_shaders[LABEL] = TRUE;
626 update (this_proj -> modelgl);
627}
628
638G_MODULE_EXPORT void run_window_color_coord (GtkDialog * win, gint response_id, gpointer data)
639{
640 qint * cid = (qint *)data;
641 int c, g, s;
642 project * this_proj = get_project_by_id(cid -> a);
643 s = cid -> b;
644 c = cid -> c;
645 g = cid -> d;
646 if (response_id == GTK_RESPONSE_OK)
647 {
648 if (g > 1) s = 0;
649 this_proj -> modelgl -> anim -> last -> img -> spcolor[g][s][c] = get_window_color (GTK_WIDGET(win));
650 int shaders[4] = {ATOMS, BONDS, POLYS, RINGS};
651 re_create_md_shaders (4, shaders, this_proj);
652 update (this_proj -> modelgl);
653 }
655}
656
657#ifdef GTK4
667G_MODULE_EXPORT void window_color_coord (GSimpleAction * action, GVariant * parameter, gpointer data)
668#else
677G_MODULE_EXPORT void window_color_coord (GtkWidget * widg, gpointer data)
678#endif
679{
680 qint * cid = (qint *)data;
681 gchar * str;
682 int c, g, s;
683 project * this_proj = get_project_by_id(cid -> a);
684 s = cid -> b;
685 c = cid -> c;
686 g = cid -> d;
687 switch (g)
688 {
689 case 0:
690 str = g_strdup_printf ("%s atom(s) %d fold coordination sphere color", this_proj -> chemistry -> label[s],
691 this_proj -> coord -> geolist[0][s][c]);
692 break;
693 case 1:
694 str = g_strdup_printf ("%s - %s coordination sphere color", this_proj -> chemistry -> label[s],
695 prepare_for_title(exact_name(env_name (this_proj, c, s, 1, NULL))));
696 break;
697 case 2:
698 str = g_strdup_printf ("Fragment N°%d color", c);
699 g = s;
700 s = 0;
701 break;
702 case 3:
703 str = g_strdup_printf ("Molecule N°%d color", c);
704 g = s;
705 s = 0;
706 break;
707 case 9:
708 str = g_strdup_printf ("%d atom chain(s) color", this_proj -> coord -> geolist[g][0][c]);
709 s = 0;
710 break;
711 default:
712 str = g_strdup_printf ("%s - %d atom ring(s) color", rings_type[s], this_proj -> coord -> geolist[g][0][c]);
713 s = 0;
714 break;
715 }
716 GtkWidget * win = gtk_color_chooser_dialog_new (str, GTK_WINDOW(this_proj -> modelgl -> win));
717 g_free (str);
718 set_color_chooser_color (win, this_proj -> modelgl -> anim -> last -> img -> spcolor[g][s][c]);
719 gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER(win), TRUE);
720 gtk_window_set_modal ((GtkWindow *)win, TRUE);
721 run_this_gtk_dialog (win, G_CALLBACK(run_window_color_coord), data);
722}
integer(kind=c_int) function chemistry()
Definition chemistry.F90:22
GtkWidget * color_box(glwin *view, int ideo, int spec, int geo)
create the color palette pointers and menus GTK3 version
Definition color_box.c:259
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
GtkWidget * p_box
Definition dlp_edit.c:112
char * rings_type[5]
Definition global.c:144
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:501
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
Definition gtk-misc.c:909
void set_color_chooser_color(GtkWidget *color_win, ColRGBA col)
set the color of a color selection window
Definition gtk-misc.c:2400
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
Definition gtk-misc.c:454
ColRGBA get_window_color(GtkWidget *color_win)
get the ColRGBA color from a color selection window
Definition gtk-misc.c:2385
project * proj
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
Definition gtk-misc.c:932
GdkRGBA colrgba_togtkrgba(ColRGBA col)
convert ColRGBA color to GdkRGBA color
Definition gtk-misc.c:1695
#define BSEP
Definition global.h:247
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:2522
void add_global_option(GtkWidget *vbox, tint *oid)
add a button to update global user preferences
@ CONTAINER_WIN
Definition global.h:252
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
Definition gtk-misc.c:984
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
create a GtkLabel with pango markup
Definition gtk-misc.c:1646
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:308
ColRGBA get_button_color(GtkColorChooser *colob)
get the ColRGBA color from a GtkColorChooser button
Definition gtk-misc.c:2371
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
Definition gtk-misc.c:2200
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:823
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
Definition gtk-misc.c:961
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2169
GtkWidget * color_button(ColRGBA col, gboolean alpha, int dimx, int dimy, GCallback handler, gpointer data)
create a color selection button
Definition gtk-misc.c:1789
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:754
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:235
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
Definition gtk-misc.c:198
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Definition gtk-misc.c:811
GtkWidget * abox(GtkWidget *box, char *lab, int vspace)
box creating routine, to help design faster elements for the GUI
Definition gtk-misc.c:2023
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:182
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:450
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:198
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
shaders
The different types of shaders in the atomes program.
Definition glwin.h:88
@ BONDS
Definition glwin.h:90
@ LABEL
Definition glwin.h:98
@ POLYS
Definition glwin.h:92
@ SELEC
Definition glwin.h:91
@ MDBOX
Definition glwin.h:93
@ MEASU
Definition glwin.h:99
@ ATOMS
Definition glwin.h:89
@ RINGS
Definition glwin.h:96
@ BACKG
Definition glwin.h:103
Function declarations for the creation of the OpenGL window.
gchar * env_name(project *this_proj, int g, int s, int f, GtkTextBuffer *buffer)
ouput the name of a coordination sphere
Definition interface.c:950
gchar * exact_name(gchar *name)
short cut to print string without spaces
Definition interface.c:370
Messaging function declarations.
position
Definition m_proj.c:48
gradient_edition * pref_gradient_win
tint * pref_pointer
GtkWidget * adv_box(GtkWidget *box, char *lab, int vspace, int size, float xalign)
create a box with markup label
Definition w_advance.c:151
background * tmp_background
gboolean preferences
Preference variable declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
Definition glwin.h:965
Definition global.h:114
Definition global.h:106
int b
Definition tab-1.c:95
int c
Definition tab-1.c:95
int d
Definition tab-1.c:95
int a
Definition tab-1.c:95
G_MODULE_EXPORT void to_run_back_color_window(GtkWidget *widg, gpointer data)
to run background color selection window callback GTK3
Definition w_colors.c:223
G_MODULE_EXPORT void set_gradient_color(GtkColorChooser *colob, gpointer data)
change background color
Definition w_colors.c:240
G_MODULE_EXPORT void to_run_box_color_window(GtkWidget *widg, gpointer data)
to run box color selection window callback GTK3
Definition w_colors.c:585
int wc_cid
Definition w_colors.c:73
void back_position_has_changed(gpointer data, GLfloat v)
change gradient mixed position
Definition w_colors.c:351
G_MODULE_EXPORT void set_back_position(GtkRange *range, gpointer data)
set gradient mixed position - range callback
Definition w_colors.c:391
G_MODULE_EXPORT gboolean on_gradient_delete(GtkWidget *widg, GdkEvent *event, gpointer data)
gradient window delete event - GTK3
Definition w_colors.c:416
G_MODULE_EXPORT void gradient_advanced(GtkWidget *widg, gpointer data)
Background configuration window.
Definition w_colors.c:434
G_MODULE_EXPORT void set_gradient_parameter(GtkWidget *widg, gpointer data)
set gradient parameter callback
Definition w_colors.c:288
G_MODULE_EXPORT gboolean scroll_set_back_position(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
set gradient mixed position - scroll callback
Definition w_colors.c:377
G_MODULE_EXPORT void window_color_coord(GtkWidget *widg, gpointer data)
create a window to select a color callback GTK3
Definition w_colors.c:677
void update_gradient_widgets(gradient_edition *gradient_win, background *back)
update the widgets of the gradient window
Definition w_colors.c:84
G_MODULE_EXPORT void run_window_color(GtkDialog *win, gint response_id, gpointer data)
window color chooser - running the dialog
Definition w_colors.c:125
void window_color(project *this_proj, glwin *view)
window color chooser - creating the dialog
Definition w_colors.c:169
G_MODULE_EXPORT void run_window_color_coord(GtkDialog *win, gint response_id, gpointer data)
window to select a color - running the dialog
Definition w_colors.c:638
G_MODULE_EXPORT void to_run_atom_color_window(GtkWidget *widg, gpointer data)
to run atom color selection window callback GTK3
Definition w_colors.c:615
GtkWidget * hbox
Definition workspace.c:71
GtkWidget * img
Definition workspace.c:70
GtkWidget * vbox
Definition workspace.c:72