atomes 1.2.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
m_box.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: 'm_box.c'
24*
25* Contains:
26*
27
28 - The functions to create the 'Model -> Box' submenu
29
30*
31* List of functions:
32
33 void update_show_hide_box_axis (glwin * view, int box_or_axis, int status);
34
35 G_MODULE_EXPORT void set_box_axis_style (GtkWidget * widg, gpointer data);
36 G_MODULE_EXPORT void show_hide_box_axis (GSimpleAction * action, GVariant * parameter, gpointer data);
37 G_MODULE_EXPORT void change_box_axis_radio (GSimpleAction * action, GVariant * parameter, gpointer data);
38
39 GtkWidget * create_box_axis_menu (char * name, int val, int box, GtkWidget * menu, tint * data);
40 GtkWidget * create_color_widget (GtkWidget * widg, glwin * view, int va);
41 GtkWidget * create_layout_widget (gchar * str, GtkWidget * menu, int vab, gpointer data);
42 GtkWidget * menu_box_axis (glwin * view, int id, int ab);
43
44 GMenuItem * menu_box_axis (glwin * view, int popm, int ab);
45
46 GMenu * axis_box_style (glwin * view, int popm, int ab, int abs);
47 GMenu * axis_box_param (glwin * view, int popm, int ab, int style);
48 GMenuItem * menu_box_axis (glwin * view, int popm, int ab);
49
50*/
51
52#include "global.h"
53#include "glview.h"
54#include "glwindow.h"
55#include "color_box.h"
56#include "submenus.h"
57
58
59G_MODULE_EXPORT void box_advanced (GtkWidget * widg, gpointer data);
60#ifdef GTK4
61extern G_MODULE_EXPORT void window_bonds (GSimpleAction * action, GVariant * parameter, gpointer data);
62#else
63extern G_MODULE_EXPORT void window_bonds (GtkWidget * widg, gpointer data);
64#endif
65
66extern gboolean from_box_or_axis;
67
68#ifdef GTK4
78G_MODULE_EXPORT void to_box_advanced (GSimpleAction * action, GVariant * parameter, gpointer data)
79{
80 box_advanced (NULL, data);
81}
82#endif
83
89void update_show_hide_box_axis (glwin * view, int box_or_axis, int status)
90{
91 switch (box_or_axis)
92 {
93 case 0:
94 if (view -> box_win)
95 {
96 if (view -> box_win -> show_hide && GTK_IS_WIDGET(view -> box_win -> show_hide))
97 {
98 button_set_status (view -> box_win -> show_hide, ! status);
99 }
100 }
101 break;
102 case 1:
103 if (view -> axis_win)
104 {
105 if (view -> axis_win -> show_hide && GTK_IS_WIDGET(view -> axis_win -> show_hide))
106 {
107 button_set_status (view -> axis_win -> show_hide, ! status);
108 }
109 }
110 break;
111 }
112}
113
114#ifdef GTK3
115// GTK3 Menu Action To Check
124G_MODULE_EXPORT void set_box_axis_style (GtkWidget * widg, gpointer data)
125{
126 tint * the_data = (tint *)data;
127 int i, j, k, l, m, n;
128 j = the_data -> b;
129 n = the_data -> c;
130 glwin * view = get_project_by_id(the_data -> a) -> modelgl;
131 k = (n) ? view -> anim -> last -> img -> xyz -> axis : view -> anim -> last -> img -> abc -> box;
132
133 int dim[2]={OGL_BOX, OGL_AXIS};
134 l = (k == NONE) ? 2 : (j == WIREFRAME) ? 2 : 1;
135 m = (k == NONE) ? 0 : (j == WIREFRAME) ? 1 : 2;
136 if (k != j && gtk_check_menu_item_get_active ((GtkCheckMenuItem *)widg))
137 {
138 if (n)
139 {
140 view -> anim -> last -> img -> xyz -> axis = NONE - 1;
141 }
142 else
143 {
144 view -> anim -> last -> img -> abc -> box = NONE - 1;
145 }
146 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[n][l], FALSE);
147 show_the_widgets (view -> ogl_box_axis[n][3+2*(m-1)]);
148 hide_the_widgets (view -> ogl_box_axis[n][3+2*(l-1)]);
149 if (widg != view -> ogl_box_axis[n][(k == NONE) ? 1 : m])
150 {
151 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[n][(k == NONE) ? 1 : m], TRUE);
152 }
153 for (i=1; i<dim[n]; i++) widget_set_sensitive (view -> ogl_box_axis[n][i], 1);
154 if (n)
155 {
156 view -> anim -> last -> img -> xyz -> axis = (k == NONE) ? WIREFRAME : j;
157 }
158 else
159 {
160 view -> anim -> last -> img -> abc -> box = (k == NONE) ? WIREFRAME : j;
161 }
162
163 }
164 else if (k == j && ! gtk_check_menu_item_get_active ((GtkCheckMenuItem *)widg))
165 {
166 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[n][(k == NONE) ? 1 : m], TRUE);
167 }
168 else if (j == 0)
169 {
170 for (i=1; i<3; i++)
171 {
172 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[n][i], FALSE);
173 widget_set_sensitive (view -> ogl_box_axis[n][i], 0);
174 widget_set_sensitive (view -> ogl_box_axis[n][i], 0);
175 }
176 widget_set_sensitive (view -> ogl_box_axis[n][4], 0);
177 for (i=6; i<dim[n]; i++)
178 {
179 widget_set_sensitive (view -> ogl_box_axis[n][i], 0);
180 }
181 if (widg != view -> ogl_box_axis[n][0]) gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[n][0], FALSE);
182 if (n)
183 {
184 view -> anim -> last -> img -> xyz -> axis = NONE;
185 }
186 else
187 {
188 view -> anim -> last -> img -> abc -> box = NONE;
189 }
190 }
191 if (n)
192 {
193 i = (view -> anim -> last -> img -> xyz -> axis == NONE) ? NONE : (view -> anim -> last -> img -> xyz -> axis == WIREFRAME) ? 0 : 1;
194 }
195 else
196 {
197 i = (view -> anim -> last -> img -> abc -> box == NONE) ? NONE : (view -> anim -> last -> img -> abc -> box == WIREFRAME) ? 0 : 1;
198 }
199 switch (n)
200 {
201 case 0:
202 if (view -> box_win)
203 {
204 if (view -> box_win -> styles && GTK_IS_WIDGET(view -> box_win -> styles))
205 {
206 combo_set_active (view -> box_win -> styles, i);
207 }
208 }
209 break;
210 case 1:
211 if (view -> axis_win)
212 {
213 if (view -> axis_win -> styles && GTK_IS_WIDGET(view -> axis_win -> styles))
214 {
215 combo_set_active (view -> axis_win -> styles, i);
216 }
217 }
218 break;
219 }
220 if (! from_box_or_axis) update_show_hide_box_axis (view, n, (i == NONE) ? 1 : 0);
221 view -> create_shaders[n+MDBOX] = TRUE;
222 update (view);
223}
224
236GtkWidget * create_box_axis_menu (char * name, int val, int box, GtkWidget * menu, tint * data)
237{
238 GtkWidget * box_widget = gtk3_menu_item (menu, name, IMG_NONE, NULL, G_CALLBACK(set_box_axis_style), data,
239 FALSE, 0, 0, TRUE, (data -> b != 0) ? TRUE : FALSE, (box == val && val != NONE) ? TRUE : FALSE);
240 if (data -> b != 0)
241 {
242 if (val == NONE)
243 {
244 widget_set_sensitive (box_widget, 0);
245 }
246 }
247 return box_widget;
248}
249
259GtkWidget * create_color_widget (GtkWidget * widg, glwin * view, int va)
260{
261 GtkWidget * color_widget = color_box(view, -1, 0, 0);
262 gtk_menu_item_set_submenu ((GtkMenuItem *)widg, color_widget);
263 if (va == NONE)
264 {
265 widget_set_sensitive (color_widget, 0);
266 }
267 return color_widget;
268}
269
280GtkWidget * create_layout_widget (gchar * str, GtkWidget * menu, int vab, gpointer data)
281{
282 GtkWidget * layout = create_menu_item (TRUE, str);
283 gtk_menu_shell_append ((GtkMenuShell *)menu, layout);
284 g_signal_connect (G_OBJECT (layout), "activate", G_CALLBACK(window_bonds), data);
285 if (vab == NONE) widget_set_sensitive (layout, 0);
286 return layout;
287}
288
298GtkWidget * menu_box_axis (glwin * view, int id, int ab)
299{
300 GtkWidget * widg;
301 gchar * menu_title[2]={"Box", "Axis"};
302 GtkWidget * ab_menu;
303 GtkWidget * menu_ab = gtk_menu_new ();
304 if (id == 0 && ab == 0)
305 {
306 view -> ogl_box[0] = create_menu_item (TRUE, menu_title[ab]);
307 gtk_menu_item_set_submenu ((GtkMenuItem *)view -> ogl_box[0], menu_ab);
308 widget_set_sensitive (view -> ogl_box[0], get_project_by_id(view -> proj) -> cell.ltype);
309 }
310 else
311 {
312 ab_menu = create_menu_item (TRUE, menu_title[ab]);
313 gtk_menu_item_set_submenu ((GtkMenuItem *)ab_menu, menu_ab);
314 if (ab == 0) widget_set_sensitive (ab_menu, get_project_by_id(view -> proj) -> cell.ltype);
315 }
316
317 GtkWidget * menul;
318 int i = (ab) ? view -> anim -> last -> img -> xyz -> axis : view -> anim -> last -> img -> abc -> box;
319 if (id == 0)
320 {
321 view -> ogl_box_axis[ab][0] = create_box_axis_menu ("Show/_Hide", i, i, menu_ab, & view -> colorp[0][ab]);
322 }
323 else
324 {
325 widg = create_box_axis_menu ("Show/Hide", i, i, menu_ab, & view -> colorp[0][ab]);
326 }
327 widg = create_menu_item (FALSE, "Style");
328 gtk_menu_shell_append ((GtkMenuShell *)menu_ab, widg);
329 GtkWidget * menus = gtk_menu_new ();
330 gtk_menu_item_set_submenu ((GtkMenuItem *)widg, menus);
331 gchar * str;
332 str = g_strdup_printf ("Width [ %f pts ]", (ab) ? view -> anim -> last -> img -> xyz -> line : view -> anim -> last -> img -> abc -> line);
333 int box_axis = (ab) ? view -> anim -> last -> img -> xyz -> axis : view -> anim -> last -> img -> abc -> box;
334 if (id == 0)
335 {
336 view -> ogl_box_axis[ab][1] = create_box_axis_menu (text_styles[1], i, 1, menus, & view -> colorp[1][ab]);
337 view -> ogl_box_axis[ab][2] = create_box_axis_menu (text_styles[4], i, 4, menus, & view -> colorp[4][ab]);
338 view -> ogl_box_axis[ab][3] = create_menu_item (TRUE, "_Lines");
339 gtk_menu_shell_append ((GtkMenuShell *)menu_ab, view -> ogl_box_axis[ab][3]);
340 menul = gtk_menu_new ();
341 gtk_menu_item_set_submenu ((GtkMenuItem *)view -> ogl_box_axis[ab][3], menul);
342 view -> ogl_box_axis[ab][4] = create_layout_widget (str, menul, box_axis, & view -> colorp[WIREFRAME][ab]);
343 }
344 else
345 {
346 create_box_axis_menu (text_styles[1], i, 1, menus, & view -> colorp[1][ab]);
347 create_box_axis_menu (text_styles[4], i, 4, menus, & view -> colorp[4][ab]);
348 if (i == WIREFRAME)
349 {
350 widg = create_menu_item (FALSE, "Lines");
351 gtk_menu_shell_append ((GtkMenuShell *)menu_ab, widg);
352 menul = gtk_menu_new ();
353 gtk_menu_item_set_submenu ((GtkMenuItem *)widg, menul);
354 widg = create_layout_widget (str, menul, box_axis, & view -> colorp[WIREFRAME][ab]);
355 }
356 }
357 g_free (str);
358
359 str = g_strdup_printf ("Radius [ %f Å ]", (ab) ? view -> anim -> last -> img -> xyz -> rad : view -> anim -> last -> img -> abc -> rad);
360 if (id == 0)
361 {
362 view -> ogl_box_axis[ab][5] = create_menu_item (FALSE, "Cylinders");
363 gtk_menu_shell_append ((GtkMenuShell *)menu_ab, view -> ogl_box_axis[ab][5]);
364 menul = gtk_menu_new ();
365 gtk_menu_item_set_submenu ((GtkMenuItem *)view -> ogl_box_axis[ab][5], menul);
366 view -> ogl_box_axis[ab][6] = create_layout_widget (str, menul, box_axis, & view -> colorp[CYLINDERS][ab]);
367 }
368 else if (i == CYLINDERS)
369 {
370 widg = create_menu_item (FALSE, "Cylinders");
371 gtk_menu_shell_append ((GtkMenuShell *)menu_ab, widg);
372 menul = gtk_menu_new ();
373 gtk_menu_item_set_submenu ((GtkMenuItem *)widg, menul);
374 widg = create_layout_widget (str, menul, box_axis, & view -> colorp[CYLINDERS][ab]);
375 }
376 g_free (str);
377
378 if (ab == 0)
379 {
380 widg = create_menu_item (FALSE, "Color");
381 gtk_menu_shell_append ((GtkMenuShell *)menu_ab, widg);
382 if (id == 0)
383 {
384 view -> ogl_box_axis[ab][7] = create_color_widget (widg, view, i);
385 }
386 else
387 {
388 widg = create_color_widget (widg, view, i);
389 }
390 add_advanced_item (menu_ab, G_CALLBACK(box_advanced), (gpointer)view, FALSE, 0, 0);
391 }
392 else
393 {
394 menu_axis (menu_ab, view, id);
395 }
396
397 if (id == 0 && ab == 0)
398 {
399 return view -> ogl_box[0];
400 }
401 else
402 {
403 return ab_menu;
404 }
405}
406#else
416G_MODULE_EXPORT void show_hide_box_axis (GSimpleAction * action, GVariant * parameter, gpointer data)
417{
418 tint * the_data = (tint *)data;
419 glwin * view = get_project_by_id(the_data -> a) -> modelgl;
420 const gchar * name = g_action_get_name ((GAction *)action);
421 int lgt = strlen (name);
422 gchar * str = g_strdup_printf ("%c%c", name[lgt-2], name[lgt-1]);
423 if (g_strcmp0(str, ".1") == 0)
424 {
425 g_free (str);
426 str = g_strdup_printf ("%.*s.0.0", lgt-4, name);
427 g_action_group_activate_action ((GActionGroup *)view -> action_group, (const gchar *)str, NULL);
428 g_free (str);
429 }
430 else
431 {
432 GVariant * state;
433 gboolean show;
434 state = g_action_get_state (G_ACTION (action));
435 show = ! g_variant_get_boolean (state);
436 if (show)
437 {
438 switch (the_data -> c)
439 {
440 case 0:
441 view -> anim -> last -> img -> abc -> box = WIREFRAME;
442 break;
443 case 1:
444 view -> anim -> last -> img -> xyz -> axis = WIREFRAME;
445 break;
446 }
447 }
448 else
449 {
450 switch (the_data -> c)
451 {
452 case 0:
453 view -> anim -> last -> img -> abc -> box = NONE;
454 break;
455 case 1:
456 view -> anim -> last -> img -> xyz -> axis = NONE;
457 break;
458 }
459 }
460 view -> create_shaders[the_data -> c+MDBOX] = TRUE;
461 update_menu_bar (view);
462 update (view);
463 g_action_change_state (G_ACTION (action), g_variant_new_boolean (show));
464 g_variant_unref (state);
465 update_show_hide_box_axis (view, the_data -> c, ! show);
466 }
467}
468
478G_MODULE_EXPORT void change_box_axis_radio (GSimpleAction * action, GVariant * parameter, gpointer data)
479{
480 tint * the_data = (tint *)data;
481 int i, j;
482 i = the_data -> c;
483 glwin * view = get_project_by_id (the_data -> a) -> modelgl;
484 const gchar * style = g_variant_get_string (parameter, NULL);
485 int lgt = strlen (style);
486 gchar * name = g_strdup_printf ("%c%c", style[lgt-2], style[lgt-1]);
487 if (g_strcmp0(name, ".1") == 0)
488 {
489 name = g_strdup_printf ("%.*s.0", lgt-2, style);
490 gchar * str = g_strdup_printf ("set-%s-style", (i) ? "axis" : "box");
491 g_action_group_activate_action ((GActionGroup *)view -> action_group, (const gchar *)str, g_variant_new_string((const gchar *)name));
492 g_free (str);
493 g_free (name);
494 }
495 else
496 {
497 gchar * style_name = NULL;
498 gchar * str = g_strdup_printf ("set-%s-style", (i) ? "axis" : "box");
499 for (j=0; j<2; j++)
500 {
501 style_name = g_strdup_printf ("%s.%d.0", str, j);
502 if (g_strcmp0(style, (const gchar *)style_name) == 0)
503 {
504 if (i)
505 {
506 view -> anim -> last -> img -> xyz -> axis = (j == 0) ? WIREFRAME : CYLINDERS;
507 }
508 else
509 {
510 view -> anim -> last -> img -> abc -> box = (j == 0) ? WIREFRAME : CYLINDERS;
511 }
512 view -> create_shaders[i+MDBOX] = TRUE;
513 update (view);
514 update_menu_bar (view);
515 g_free (style_name);
516 style_name = NULL;
517 break;
518 }
519 g_free (style_name);
520 style_name = NULL;
521 }
522 g_free (str);
523 g_action_change_state (G_ACTION (action), parameter);
524 }
525}
526
537GMenu * axis_box_style (glwin * view, int popm, int ab, int abs)
538{
539 GMenu * menu = g_menu_new ();
540 gchar * str = g_strdup_printf ("%s-style", (ab) ? "axis" : "box");
541 append_opengl_item (view, menu, text_styles[1], str, popm, 0, NULL, IMG_NONE, NULL, FALSE,
542 G_CALLBACK(change_box_axis_radio), & view -> colorp[1][ab], FALSE, (abs == WIREFRAME) ? TRUE : FALSE,
543 TRUE, (abs != NONE) ? TRUE : FALSE);
544 g_free (str);
545 str = g_strdup_printf ("%s-style", (ab) ? "axis" : "box");
546 append_opengl_item (view, menu, text_styles[4], str, popm, 1, NULL, IMG_NONE, NULL, FALSE,
547 G_CALLBACK(change_box_axis_radio), & view -> colorp[4][ab], FALSE, (abs == CYLINDERS) ? TRUE : FALSE,
548 TRUE, (abs != NONE) ? TRUE : FALSE);
549 g_free (str);
550 return menu;
551}
552
563GMenu * axis_box_param (glwin * view, int popm, int ab, int style)
564{
565 gchar * str, * key;
566 if (style == WIREFRAME)
567 {
568 str = g_strdup_printf ("Width [ %f pts ]", (ab) ? view -> anim -> last -> img -> xyz -> line : view -> anim -> last -> img -> abc -> line);
569 key = g_strdup_printf ("%s-width", (ab) ? "axis" : "box");
570 }
571 else if (style == CYLINDERS)
572 {
573 str = g_strdup_printf ("Radius [ %f Å ]", (ab) ? view -> anim -> last -> img -> xyz -> rad : view -> anim -> last -> img -> abc -> rad);
574 key = g_strdup_printf ("%s-radius", (ab) ? "axis" : "box");
575 }
576 else
577 {
578 str = g_strdup_printf (" length [ %f Å ]", view -> anim -> last -> img -> xyz -> length);
579 key = g_strdup_printf ("axis-legnth");
580 }
581 GMenu * menu = g_menu_new ();
582 append_opengl_item (view, menu, str, key, popm, ab, NULL, IMG_NONE, NULL, FALSE,
583 G_CALLBACK(window_bonds), & view -> colorp[style][ab], FALSE, FALSE, FALSE, TRUE);
584 g_free (str);
585 g_free (key);
586 return menu;
587}
588
598GMenuItem * menu_box_axis (glwin * view, int popm, int ab)
599{
600 GMenuItem * ab_item = g_menu_item_new ((ab) ? "Axis" : "Box", (ab) ? NULL : (get_project_by_id(view -> proj) -> cell.ltype) ? NULL : "None");
601 int i = (ab) ? view -> anim -> last -> img -> xyz -> axis : view -> anim -> last -> img -> abc -> box;
602 GMenu * menu = g_menu_new ();
603 append_opengl_item (view, menu, "Show/Hide", (ab) ? "show-axis" : "show-box", popm, popm, NULL, IMG_NONE, NULL, FALSE,
604 G_CALLBACK(show_hide_box_axis), & view -> colorp[0][ab], TRUE, (i != NONE) ? TRUE : FALSE, FALSE, (ab) ? TRUE : get_project_by_id(view -> proj) -> cell.ltype);
605
606 append_submenu (menu, "Style", axis_box_style (view, popm, ab, i));
607 GMenuItem * item ;
608 if (i == WIREFRAME)
609 {
610 item = g_menu_item_new ("Lines", NULL);
611 g_menu_item_set_attribute (item, "custom", "s", (ab) ? "axis-lines" : "box-lines", NULL);
612 g_menu_item_set_submenu (item, (GMenuModel *)axis_box_param (view, popm, ab, WIREFRAME));
613 g_menu_append_item (menu, item);
614 }
615 if (i == CYLINDERS)
616 {
617 item = g_menu_item_new ("Cylinders", NULL);
618 g_menu_item_set_attribute (item, "custom", "s", (ab) ? "axis-cylinders" : "box-cylinders", NULL);
619 g_menu_item_set_submenu (item, (GMenuModel *)axis_box_param (view, popm, ab, CYLINDERS));
620 g_menu_append_item (menu, item);
621 }
622
623 if (ab == 0)
624 {
625 GMenu * menuc = g_menu_new ();
626 append_opengl_item (view, menuc, "box-color", "box-color", popm, popm, NULL, IMG_NONE, NULL, TRUE, NULL, NULL, FALSE, FALSE, FALSE, FALSE);
627 append_opengl_item (view, menuc, "More colors ...", "box-color", popm, popm, NULL, IMG_NONE, NULL, FALSE,
628 G_CALLBACK(to_run_box_color_window), view, FALSE, FALSE, FALSE, get_project_by_id(view -> proj) -> cell.ltype);
629 append_submenu (menu, "Color", menuc);
630 g_object_unref (menuc);
631 append_opengl_item (view, menu, "Advanced", "box-advanced", popm, popm, NULL, IMG_STOCK, DPROPERTIES, FALSE,
632 G_CALLBACK(to_box_advanced), (gpointer)view, FALSE, FALSE, FALSE, TRUE);
633 }
634 else
635 {
636 menu_axis (menu, view, popm);
637 }
638 g_menu_item_set_submenu (ab_item, (GMenuModel *)menu);
639 return ab_item;
640}
641#endif
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.
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
color colorp[64]
PangoLayout * layout
Definition curve.c:79
float val
Definition dlp_init.c:117
Global variable declarations Global convenience function declarations Global data structure defin...
@ IMG_NONE
Definition global.h:262
@ IMG_STOCK
Definition global.h:266
GtkWidget * gtk3_menu_item(GtkWidget *menu, gchar *name, int icon_format, gpointer item_icon, GCallback handler, gpointer data, gboolean accel, guint key, GdkModifierType mod, gboolean check, gboolean radio, gboolean status)
project * proj
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
Definition gtk-misc.c:932
void append_submenu(GMenu *menu, const gchar *label, GMenu *submenu)
append a GMenuItem with a subenu to a GMenu, and use markup for the GMenuItem
Definition gui.c:732
void button_set_status(GtkWidget *button, int status)
set status of check / toggle button
Definition gtk-misc.c:1872
GtkWidget * add_advanced_item(GtkWidget *menu, GCallback handler, gpointer data, gboolean accel, guint key, GdkModifierType mod)
#define DPROPERTIES
Definition global.h:208
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:215
GtkWidget * create_menu_item(gboolean add_mnemo, gchar *action)
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
Definition gtk-misc.c:198
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...
action
Definition glview.h:198
styles
Definition glview.h:180
@ CYLINDERS
Definition glview.h:186
@ WIREFRAME
Definition glview.h:183
@ NONE
Definition glview.h:181
struct box box
box layout data structure
Definition glwin.h:349
#define OGL_BOX
Definition glwin.h:58
@ MDBOX
Definition glwin.h:93
#define OGL_AXIS
Definition glwin.h:59
char * text_styles[OGL_STYLES]
Definition m_style.c:55
G_MODULE_EXPORT void set_box_axis_style(GtkWidget *widg, gpointer data)
Function declarations for the creation of the OpenGL window.
void append_opengl_item(glwin *view, GMenu *menu, const gchar *name, gchar *key, int mpop, int item_id, gchar *accel, int image_format, gpointer icon, gboolean custom, GCallback handler, gpointer data, gboolean check, gboolean status, gboolean radio, gboolean sensitive)
GtkWidget * create_layout_widget(gchar *str, GtkWidget *menu, int vab, gpointer data)
void menu_axis(GMenu *menu_ab, glwin *view, int popm)
create the 'Axis' submenu GTK4
Definition m_axis.c:330
gboolean from_box_or_axis
Definition w_box.c:52
G_MODULE_EXPORT void change_box_axis_radio(GSimpleAction *action, GVariant *parameter, gpointer data)
handle a box/axis radio menu item signal GTK4
Definition m_box.c:478
GMenuItem * menu_box_axis(glwin *view, int popm, int ab)
create the 'Model -> Box' and 'View -> Axis' submenus GTK4
Definition m_box.c:598
void update_show_hide_box_axis(glwin *view, int box_or_axis, int status)
update edition buttons with menu show / hide status
Definition m_box.c:89
G_MODULE_EXPORT void window_bonds(GtkWidget *widg, gpointer data)
create bond(s) configuration window(s) callback GTK3
Definition w_bonds.c:405
GMenu * axis_box_style(glwin *view, int popm, int ab, int abs)
create the box/axis '-> Style' submenu GTK4
Definition m_box.c:537
G_MODULE_EXPORT void box_advanced(GtkWidget *widg, gpointer data)
create the box edition window
Definition w_box.c:338
GMenu * axis_box_param(glwin *view, int popm, int ab, int style)
create the box/axis '-> Length/Width/Radius' submenus GTK4
Definition m_box.c:563
G_MODULE_EXPORT void show_hide_box_axis(GSimpleAction *action, GVariant *parameter, gpointer data)
handle the 'box/axis' show/hide signal GTK4
Definition m_box.c:416
integer abc
Definition glwin.h:333
Definition glwin.h:351
Definition glwin.h:965
Definition global.h:106
Function declarations for the creation of the OpenGL window menus.
int b
Definition tab-1.c:95
int c
Definition tab-1.c:95
int a
Definition tab-1.c:95
int status
Definition w_advance.c:178
GtkWidget * img
Definition workspace.c:70