atomes 1.1.14
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
w_periodic.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
23/*
24* This file: 'w_periodic.c'
25*
26* Contains:
27*
28
29 - The functions to create the periodic table of the elements
30 - The functions to select element from the periodic table
31
32*
33* List of functions:
34
35 int is_in_table (int i, int j);
36 int get_atom_id_from_periodic_table (atom_search * asearch);
37
38 G_MODULE_EXPORT gboolean on_element_focus (GtkWidget * widget, GdkEvent * event, gpointer data);
39
40 gchar * get_electronic_structure (int r, int c);
41
42 G_MODULE_EXPORT void on_element_focus (GtkEventControllerFocus * focus, gpointer data);
43 G_MODULE_EXPORT void on_element_motion_enter (GtkEventControllerMotion * motion, gdouble x, gdouble y, gpointer data);
44 G_MODULE_EXPORT void run_periodic_table (GtkDialog * info, gint response_id, gpointer data);
45 G_MODULE_EXPORT void get_element (GtkButton * but, gpointer data);
46
47 GtkWidget * create_el_preview (int p, int a, int r, int c);
48 GtkWidget * el_preview (int p, int a);
49 GtkWidget * create_css_button (int p, int id, int r, int c);
50 GtkWidget * create_css_group (int p, int i);
51 GtkWidget * css_element (int p, int i, int j);
52 GtkWidget * periodic_table (int p, int a);
53
54*/
55
56#include "global.h"
57
58extern insertion_menu mol[];
59
62
64
65ColRGBA rtcolo[11] = {{142, 255, 142, 1.0}, // #8EFF8E
66 {245, 255, 83, 1.0}, // #F5FF53
67 {255, 184, 83, 1.0}, // #FFB853
68 {255, 108, 125, 1.0}, // #FF6C7D
69 {244, 167, 255, 1.0}, // #F4A7FF
70 {64, 133, 56}, // #408538
71 {177, 94, 255}, // #B15EFF
72 {142, 227, 255, 1.0}, // #8EE3FF
73 {80, 93, 253, 1.0}, // #505DFD
74 {126, 255, 235, 1.0}, // #7EFFEB
75 {95, 192, 176, 1.0}}; // #5FC0B0
76gchar * ptcolo[11] = {"#8EFF8E", "#F5FF53", "#FFB853", "#FF6C7D", "#F4A7FF", "#408538", "#B15EFF", "#8EE3FF", "#505DFD", "#7EFFEB", "#5FC0B0"};
77
86gchar * get_electronic_structure (int r, int c)
87{
88 gchar * str = NULL;
89 gchar * prev[10]={" ", "He", "Ne", "Ar", "Kr", "Xe", "Rn", " ", "Xe", "Rn"};
90 if (r == -1 && c == -1) return g_strdup_printf ("Electronic structure: [None]");
91 if (r > 0)
92 {
93 str = g_strdup_printf ("Electronic structure:\t [%s]", prev[r]);
94 }
95 else
96 {
97 str = g_strdup_printf ("Electronic structure:\t ");
98 }
99
100 if (c < 2)
101 {
102 str = g_strdup_printf ("%s %ds<sup>%d</sup>", str, r+1, c+1);
103 }
104 else
105 {
106 if (r < 3)
107 {
108 str = g_strdup_printf ("%s %ds<sup>%d</sup> %dp<sup>%d</sup>", str, r+1, 2, r+1, c-11);
109 }
110 else if (r < 5)
111 {
112 if (c == 5 || c == 10)
113 {
114 str = g_strdup_printf ("%s %dd<sup>%d</sup> %ds<sup>%d</sup>", str, r, c, r+1, 1);
115 }
116 else if (r == 4 && (c == 4 || c == 7 ||c == 8))
117 {
118 str = g_strdup_printf ("%s %dd<sup>%d</sup> %ds<sup>%d</sup>", str, r, c, r+1, 1);
119 }
120 else if (r == 4 && c == 9)
121 {
122 str = g_strdup_printf ("%s %dd<sup>%d</sup>", str, r, 10);
123 }
124 else if (c < 12)
125 {
126 str = g_strdup_printf ("%s %dd<sup>%d</sup> %ds<sup>%d</sup>", str, r, c-1, r+1, 2);
127 }
128 else
129 {
130 str = g_strdup_printf ("%s %dd<sup>%d</sup> %ds<sup>%d</sup> %dp<sup>%d</sup>", str, r, 10, r+1, 2, r+1, c-11);
131 }
132 }
133 else if (r < 7)
134 {
135 if (c == 9 || c == 10)
136 {
137 str = g_strdup_printf ("%s %df<sup>%d</sup> %dd<sup>%d</sup> %ds<sup>%d</sup>", str, r-1, 14, r, c, r+1, 1);
138 }
139 else if (c < 12)
140 {
141 str = g_strdup_printf ("%s %df<sup>%d</sup> %dd<sup>%d</sup> %ds<sup>%d</sup>", str, r-1, 14, r, c-1, r+1, 2);
142 }
143 else
144 {
145 str = g_strdup_printf ("%s %df<sup>%d</sup> %dd<sup>%d</sup> %ds<sup>%d</sup> %dp<sup>%d</sup>", str, r-1, 14, r, 10, r+1, 2, r+1, c-11);
146 }
147 }
148 else if (c == 3)
149 {
150 str = g_strdup_printf ("%s %dd<sup>%d</sup> %ds<sup>%d</sup>", str, r-3, c-2, r-2, 2);
151 }
152 else if ((c > 7 && c < 10) || (c > 10 && c < 17))
153 {
154 str = g_strdup_printf ("%s %df<sup>%d</sup> %ds<sup>%d</sup>", str, r-4, c-2, r-2, 2);
155 }
156 else if (r == 8)
157 {
158 if (c > 4 && c < 8)
159 {
160 str = g_strdup_printf ("%s %df<sup>%d</sup> %ds<sup>%d</sup>", str, r-4, c-2, r-2, 2);
161 }
162 else
163 {
164 str = g_strdup_printf ("%s 4f<sup>%d</sup> 5d<sup>1</sup> 6s<sup>2</sup>", str, c-3);
165 }
166 }
167 else
168 {
169 if (c == 4)
170 {
171 str = g_strdup_printf ("%s %dd<sup>%d</sup> %ds<sup>%d</sup>", str, r-3, c-2, r-2, 2);
172 }
173 else if (c == 17)
174 {
175 str = g_strdup_printf ("%s %df<sup>%d</sup> %ds<sup>%d</sup> %dp<sup>%d</sup>", str, r-4, c-3, r-2, 2, r-2, 1);
176 }
177 else
178 {
179 str = g_strdup_printf ("%s %df<sup>%d</sup> %dd<sup>%d</sup> %ds<sup>%d</sup>", str, r-4, c-3, r-3, 1, r-2, 2);
180 }
181 }
182 }
183 return str;
184}
185
194int is_in_table (int i, int j)
195{
196 if (i == 7) return 0;
197 if (i == 0 && (j > 0 && j < 17)) return 0;
198 if ((i == 1 || i == 2) && (j > 1 && j < 12)) return 0;
199 if ((i == 5 || i == 6) && j ==2) return 0;
200 if (i > 7 && j< 3) return 0;
201 if (i > 2 && i < 5) return 19 + (i-3)*18 + j;
202 if (i == 0)
203 {
204 if (j==0)
205 {
206 return 1;
207 }
208 else
209 {
210 return 2;
211 }
212 }
213 if (i > 0 && i < 3) return 2 + j+1 - 10 * (j/11) + 8 * (i/2);
214 if (i == 5 && j < 2) return 55 + j;
215 if (i == 6 && j < 2) return 87 + j;
216 if (i == 5 && j > 2) return 72 + j-3;
217 if (i == 6 && j > 2) return 104 + j-3;
218 if (i == 8) return 57 + j-3;
219 if (i == 9) return 89 + j-3;
220 return -1;
221}
222
233GtkWidget * create_el_preview (int p, int a, int r, int c)
234{
235 GtkWidget * preview = create_vbox (5);
236 GtkWidget * hbox;
237 GtkWidget * lab[5];
238 int i, id;
239 int size[5] = {125, 30, 15, 15, 15};
240 gchar * backcol;
241 gchar * name;
242 gchar * str;
243 if (r < 0 && c < 0)
244 {
245 id = 0;
246 }
247 else
248 {
249 id = is_in_table (r, c);
250 }
251 for (i=0; i<5; i++)
252 {
253 backcol = g_strdup_printf ("label#prev-%d-%d-%d {\n"
254 " color: black;\n"
255 " font-weight: bold;\n"
256 " font-size: %dpx;\n"
257 "}\n", i, p, a, size[i]);
258 provide_gtk_css (backcol);
259 g_free (backcol);
260 if (i == 2 || i == 4) hbox = create_hbox (0);
261 name = g_strdup_printf ("prev-%d-%d-%d", i, p, a);
262 switch (i)
263 {
264 case 0:
265 lab[i] = gtk_label_new (periodic_table_info[id].lab);
266 break;
267 case 1:
268 lab[i] = gtk_label_new (periodic_table_info[id].name);
269 break;
270 case 2:
271 str = g_strdup_printf ("Z= %d", periodic_table_info[id].Z);
272 lab[i] = gtk_label_new (str);
273 g_free (str);
274 break;
275 case 3:
276 str = g_strdup_printf ("M= %.3f g/mol", periodic_table_info[id].M);
277 lab[i] = gtk_label_new (str);
278 g_free (str);
279 break;
280 case 4:
281 lab[i] = markup_label(get_electronic_structure (r, c), -1, -1, 0.0, 0.5);
282 break;
283
284 }
285 gtk_widget_set_name (lab[i], name);
286 g_free (name);
287 if (i < 2)
288 {
289 add_box_child_start (GTK_ORIENTATION_VERTICAL, preview, lab[i], FALSE, FALSE, 0);
290 }
291 else
292 {
293 if (i == 2 || i == 4) add_box_child_start (GTK_ORIENTATION_VERTICAL, preview, hbox, FALSE, FALSE, 0);
294 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, lab[i], FALSE, FALSE, 30);
295 }
296 }
297 show_the_widgets (preview);
298 return preview;
299}
300
309GtkWidget * el_preview (int p, int a)
310{
311 GtkWidget * preview = create_vbox (BSEP);
312 gchar * backcol = g_strdup_printf ("box#preview-%d-%d {\n"
313 "border: 3px solid black;\n"
314 "background-color: white;\n"
315 "border-top-left-radius: 60px 90px;\n"
316 "border-bottom-right-radius: 60px 90px;\n"
317#ifdef GTK3
318 "box-shadow: 5px 5px 5px 5px rgba(0,0,0,0.4), 2px 2px 0px 1px rgba(0,0,0,0.4) inset;\n"
319#endif // GTK3
320 "}\n", p, a);
321 provide_gtk_css (backcol);
322 g_free (backcol);
323 gchar * str = g_strdup_printf ("preview-%d-%d", p, a);
324 gtk_widget_set_name (preview, str);
325 g_free (str);
326 periodic_search -> preview[1] = create_el_preview (p, a, -1, -1);
327 gtk_widget_set_size_request (preview, 400, 275);
328 add_box_child_start (GTK_ORIENTATION_VERTICAL, preview, periodic_search -> preview[1], FALSE, FALSE, 0);
329 return preview;
330}
331
332#ifdef GTK4
341G_MODULE_EXPORT void on_element_focus (GtkEventControllerFocus * focus, gpointer data)
342#else
352G_MODULE_EXPORT gboolean on_element_focus (GtkWidget * widget, GdkEvent * event, gpointer data)
353#endif
354{
355 dint * id = (dint *)data;
356 periodic_search -> preview[1] = destroy_this_widget (periodic_search -> preview[1]);
357 periodic_search -> preview[1] = create_el_preview (periodic_search -> proj, periodic_search -> action, id -> a, id -> b);
358 add_box_child_start (GTK_ORIENTATION_VERTICAL, periodic_search -> preview[0], periodic_search -> preview[1], FALSE, FALSE, 0);
359#ifdef GTK3
360 return FALSE;
361#endif
362}
363#ifdef GTK4
374G_MODULE_EXPORT void on_element_motion_enter (GtkEventControllerMotion * motion, gdouble x, gdouble y, gpointer data)
375{
376 dint * id = (dint *)data;
377 periodic_search -> preview[1] = destroy_this_widget (periodic_search -> preview[1]);
378 periodic_search -> preview[1] = create_el_preview (periodic_search -> proj, periodic_search -> action, id -> a, id -> b);
379 add_box_child_start (GTK_ORIENTATION_VERTICAL, periodic_search -> preview[0], periodic_search -> preview[1], FALSE, FALSE, 0);
380}
381#endif
382
392G_MODULE_EXPORT void run_periodic_table (GtkDialog * info, gint response_id, gpointer data)
393{
394 destroy_this_dialog (info);
395}
396
405G_MODULE_EXPORT void get_element (GtkButton * but, gpointer data)
406{
407 element = GPOINTER_TO_INT(data);
408 run_periodic_table (GTK_DIALOG(get_top_level(GTK_WIDGET(but))), 0, NULL);
409 // g_signal_emit_by_name (G_OBJECT(get_top_level(but)), "activate", data);
410}
411
422GtkWidget * create_css_button (int p, int id, int r, int c)
423{
424 int i;
425
426 switch (r)
427 {
428 case 8:
429 i = 9;
430 break;
431 case 9:
432 i = 10;
433 break;
434 default:
435 switch (c)
436 {
437 case 1:
438 i = 2;
439 break;
440 case 2:
441 i = 3;
442 break;
443 case 11:
444 i = 4;
445 break;
446 case 12:
447 i = 4;
448 if (r == 1) i = 7;
449 if (r == 6) i = 6;
450 break;
451 case 17:
452 i = 6;
453 if (r < 6) i = 8;
454 break;
455
456 default:
457 if ((r == 0 && c == 0) || (r==1 && (c > 13 && c < 17)) || ((r>1 && r <5) && c == 16))
458 {
459 i = 0;
460 }
461 else if (c == 0)
462 {
463 i = 1;
464 }
465 else if (c > 2 && c < 8)
466 {
467 i = 3;
468 }
469 else if ((c > 7 && c <11) && r < 6)
470 {
471 i = 3;
472 }
473 else if (r==6 && ((c > 7 && c < 11) || c > 11))
474 {
475 i = 6;
476 }
477 else if (c==13 && (r == 4 || r == 5))
478 {
479 i = 4;
480 }
481 else if ((c == 14 || c == 15) && r == 5)
482 {
483 i = 4;
484 }
485 else if ((r==1 && c==13) || (r==2 && (c==14||c==15)) || (r==3 && c==15))
486 {
487 i = 5;
488 }
489 else
490 {
491 i = 7;
492 }
493 break;
494 }
495 }
496 if (c == 2 && r == 5) i = 9;
497 if (c == 2 && r ==6) i = 10;
498
499 GtkWidget * but;
500 if (p != -1)
501 {
502 but = create_button (NULL, IMG_NONE, NULL, -1, -1, GTK_RELIEF_NONE, G_CALLBACK(get_element), GINT_TO_POINTER(id));
503 }
504 else
505 {
506 but = create_button (NULL, IMG_NONE, NULL, -1, -1, GTK_RELIEF_NONE, NULL, NULL);
507 }
508 gchar * butcol = g_strdup_printf ("button#element-%d-%d {\n"
509 //" border-radius: 10px;\n"
510 " background-color: %s;\n"
511 " border-color: black;\n"
512 " border-width: 1px;\n"
513 " color: black;\n"
514 " font-weight: bold;\n"
515 "}\n"
516 "button#element-%d-%d:hover {\n"
517 " background-color: rgba(255,255,255,0.3);\n"
518 " color: %s;\n"
519 " font-weight: bold;\n"
520 "}\n", p, id, ptcolo[i], p, id, ptcolo[i]);
521 provide_gtk_css (butcol);
522 g_free (butcol);
523 gchar * str = g_strdup_printf ("element-%d-%d", p, id);
524 gtk_widget_set_name (but, str);
525 g_free (str);
526 GtkWidget * lab;
527 if (id > 0)
528 {
529 GtkWidget * vbox = create_vbox (BSEP);
530 lab = gtk_label_new (periodic_table_info[id].lab);
531 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, lab, FALSE, FALSE, 0);
532 gchar * labcol = g_strdup_printf ("label#mass-%d-%d {\n"
533 " font-size: 10px;"
534 "}\n", p, id);
535 str = g_strdup_printf ("%d", periodic_table_info[id].Z);
536 lab = gtk_label_new (str);
537 provide_gtk_css (labcol);
538 g_free (labcol);
539 str = g_strdup_printf ("mass-%d-%d", p, id);
540 gtk_widget_set_name (lab, str);
541 g_free (str);
542 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, lab, FALSE, FALSE, 0);
544 table_p[id-1].a = r;
545 table_p[id-1].b = c;
546#ifdef GTK3
547 g_signal_connect (G_OBJECT (but), "enter-notify-event", G_CALLBACK(on_element_focus), & table_p[id-1]);
548#endif
549 }
550 else
551 {
552 lab = gtk_label_new (" ");
553 gtk_label_align (lab, 0.5, 0.5);
555 }
556#ifdef GTK4
557 GtkEventController * focus = gtk_event_controller_focus_new ();
558 g_signal_connect (G_OBJECT (focus), "enter", G_CALLBACK(on_element_focus), & table_p[id-1]);
559 gtk_widget_add_controller (but, GTK_EVENT_CONTROLLER (focus));
560 GtkEventController * motion = gtk_event_controller_motion_new ();
561 g_signal_connect (motion, "enter", G_CALLBACK(on_element_motion_enter), & table_p[id-1]);
562 gtk_widget_add_controller (but, GTK_EVENT_CONTROLLER (motion));
563#endif
564 gtk_widget_show (but);
565 return but;
566}
567
576GtkWidget * create_css_group (int p, int i)
577{
578 gchar * backcol = g_strdup_printf ("label#group-%d-%d {\n"
579 " border-radius: 25px;\n"
580 " border-color: black;\n"
581 " border-width: 1px;\n"
582 " background-color: %s;\n"
583 " color: black;\n"
584 " font-weight: bold;\n"
585 "}\n", p, i, ptcolo[i]);
586 provide_gtk_css (backcol);
587 g_free (backcol);
588 GtkWidget * lab = gtk_label_new (" ");
589 gtk_widget_set_size_request (lab, 50, 40);
590 gtk_label_align (lab, 0.5, 0.5);
591 gchar * str = g_strdup_printf ("group-%d-%d", p, i);
592 gtk_widget_set_name (lab, str);
593 g_free (str);
594 gtk_widget_show (lab);
595 return lab;
596}
597
607GtkWidget * css_element (int p, int i, int j)
608{
609 int k = is_in_table (i, j);
610 if (k)
611 {
612 return create_css_button (p, k, i, j);
613 }
614 else if (j == 2 && (i == 5 || i == 6))
615 {
616 return create_css_button (p, i-7, i, j);
617 }
618 else
619 {
620 return gtk_label_new (" ");
621 }
622}
623
632GtkWidget * periodic_table (int p, int a)
633{
634 GtkWidget * ptable = gtk_grid_new ();
635 gtk_grid_set_row_homogeneous (GTK_GRID (ptable), TRUE);
636 gtk_grid_set_column_homogeneous (GTK_GRID (ptable), TRUE);
637 gtk_grid_set_row_spacing (GTK_GRID (ptable), 2);
638 gtk_grid_set_column_spacing (GTK_GRID (ptable), 2);
639 int i, j;
640
641 periodic_search -> preview[0] = el_preview (p, a);
642 gtk_grid_attach (GTK_GRID (ptable), periodic_search -> preview[0], 3, 0, 8, 5);
643 for (i=0; i<10; i++)
644 {
645 for (j=0; j<18; j++)
646 {
647 gtk_grid_attach (GTK_GRID (ptable), css_element(p, i, j), j, i+3, 1, 1);
648 }
649 }
650
651 gchar * groups[11] = {" <b>Alkali metal</b>", " <b>Alkaline earth metal</b>", " <b>Lanthanide</b>", " <b>Actinide</b>",
652 " <b>Transition metal</b>", " <b>Post-transition metal</b>", " <b>Metalloid</b>", " <b>Polyatomic non-metal</b>",
653 " <b>Diatomic non-metal</b>", " <b>Noble gas</b>", " <b>Unknown</b>"};
654 gtk_grid_attach (GTK_GRID (ptable), gtk_label_new (" "), 18, 0, 1, 1);
655 int colid[11] = {1, 2, 9, 10, 3, 4, 7, 5, 0, 8, 6};
656 for (i=0; i<11; i++)
657 {
658 gtk_grid_attach (GTK_GRID (ptable), create_css_group (p, colid[i]), 19, 1+i, 1, 1);
659 gtk_grid_attach (GTK_GRID (ptable), markup_label(groups[i], 120, -1, 0.0, 0.5), 20, 1+i, 3, 1);
660 }
661
662 return ptable;
663}
664
673{
674 GtkWidget * win = gtk_dialog_new ();
675 gchar * str;
676 if (asearch != NULL)
677 {
678 str = g_strdup_printf ("Element selection from the periodic table");
679 periodic_search = asearch;
680#ifdef GTK3
681 if (get_project_by_id (asearch -> proj) -> modelgl)
682 {
683
684 gtk_window_set_attached_to (GTK_WINDOW (win), get_project_by_id (asearch -> proj) -> modelgl -> win);
685 }
686 else
687 {
688 gtk_window_set_attached_to (GTK_WINDOW (win), MainWindow);
689 }
690#endif
691 }
692 else
693 {
694 str = g_strdup_printf ("Periodic table of the elements");
695 periodic_search = g_malloc0 (sizeof*periodic_search);
696 periodic_search -> proj = -1;
697 periodic_search -> action = -1;
698#ifdef GTK3
699 gtk_window_set_attached_to (GTK_WINDOW (win), MainWindow);
700#endif
701 }
702 gtk_window_set_resizable (GTK_WINDOW (win), FALSE);
703 gtk_window_set_title (GTK_WINDOW(win), str);
704 g_free (str);
705 gtk_window_set_modal (GTK_WINDOW (win), TRUE);
706 GtkWidget * vbox = dialog_get_content_area (win);
707 element = 0;
708 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, periodic_table (periodic_search -> proj, periodic_search -> action), FALSE, FALSE, 0);
709
710 run_this_gtk_dialog (win, G_CALLBACK(run_periodic_table), NULL);
711 if (asearch == NULL) g_free (periodic_search);
712 periodic_search = NULL;
713 return element;
714}
gchar * groups[230]
Definition cbuild_sg.c:43
GtkWidget * MainWindow
Definition global.c:214
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:472
@ IMG_NONE
Definition global.h:232
element_data periodic_table_info[]
Definition w_library.c:71
project * proj
#define BSEP
Definition global.h:217
@ CONTAINER_BUT
Definition global.h:225
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
Definition gtk-misc.c:1843
GtkWidget * get_top_level(GtkWidget *widg)
get the top level container, window, of a widget
Definition gtk-misc.c:2291
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
Definition gtk-misc.c:805
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
Definition gtk-misc.c:1565
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
Definition gtk-misc.c:279
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
Definition gtk-misc.c:2041
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:793
void gtk_label_align(GtkWidget *lab, float ax, float ay)
set text alignment in a GtkLabel
Definition gtk-misc.c:681
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2010
void provide_gtk_css(gchar *css)
create a css provider based on the css data
Definition gtk-misc.c:1986
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
Definition gtk-misc.c:206
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Definition gtk-misc.c:781
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:169
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
void motion(glwin *view, gint x, gint y, GdkModifierType state)
mouse motion in the OpenGL window
Definition glview.c:620
action
Definition glview.h:189
double y
Definition ogl_draw.c:57
double x
Definition ogl_draw.c:57
Definition global.h:91
int b
Definition global.h:93
int a
Definition global.h:92
int b
Definition tab-1.c:95
int c
Definition tab-1.c:95
int a
Definition tab-1.c:95
atom_search * periodic_search
Definition w_periodic.c:60
GtkWidget * css_element(int p, int i, int j)
create CSS for the periodic table elements
Definition w_periodic.c:607
dint table_p[118]
Definition w_periodic.c:63
GtkWidget * create_css_group(int p, int i)
create group CSS
Definition w_periodic.c:576
GtkWidget * periodic_table(int p, int a)
create periodic table
Definition w_periodic.c:632
G_MODULE_EXPORT gboolean on_element_focus(GtkWidget *widget, GdkEvent *event, gpointer data)
periodic table focus event callback GTK3
Definition w_periodic.c:352
int is_in_table(int i, int j)
is this (row,column) combination a chemical element ?
Definition w_periodic.c:194
gchar * ptcolo[11]
Definition w_periodic.c:76
GtkWidget * el_preview(int p, int a)
create element preview CSS widget
Definition w_periodic.c:309
gchar * get_electronic_structure(int r, int c)
get electronic structure for this (row,column) combination
Definition w_periodic.c:86
GtkWidget * create_css_button(int p, int id, int r, int c)
create CSS periodic table element button
Definition w_periodic.c:422
G_MODULE_EXPORT void run_periodic_table(GtkDialog *info, gint response_id, gpointer data)
periodic table - running the dialog
Definition w_periodic.c:392
G_MODULE_EXPORT void get_element(GtkButton *but, gpointer data)
get element from periodic table button
Definition w_periodic.c:405
int element
Definition w_periodic.c:61
int get_atom_id_from_periodic_table(atom_search *asearch)
get atom Z from selection in the periodic table
Definition w_periodic.c:672
GtkWidget * create_el_preview(int p, int a, int r, int c)
create element preview
Definition w_periodic.c:233
insertion_menu mol[]
Definition w_library.c:193
ColRGBA rtcolo[11]
Definition w_periodic.c:65
GtkWidget * hbox
Definition workspace.c:71
GtkWidget * vbox
Definition workspace.c:72
GtkWidget * lab
Definition workspace.c:73