61 j = gtk_check_menu_item_get_active ((GtkCheckMenuItem *)widg);
62 if (widg != view -> ogl_clones[0])
64 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_clones[0], j);
66 view -> anim -> last ->
img -> draw_clones =
j;
96GtkWidget * create_clone_widget (
char * name, gboolean clone, GtkWidget * menu,
glwin * view)
98 GtkWidget * clone_widget =
gtk3_menu_item (menu, name,
IMG_NONE, NULL, G_CALLBACK(
show_hide_clones), view, FALSE, 0, 0, TRUE, FALSE, clone);
113 GtkWidget * menu = gtk_menu_new ();
116 view -> ogl_clones[0] = create_clone_widget (
"Show/Hide", view -> anim -> last ->
img -> draw_clones, menu, view);
120 create_clone_widget (
"Show/Hide", view -> anim -> last ->
img -> draw_clones, menu, view);
123 if ((
id == 0) || (view -> anim -> last ->
img -> style !=
SPHERES && view -> anim -> last ->
img -> style !=
PUNT))
142 const gchar * name = g_action_get_name ((GAction *)
action);
143 if (g_strcmp0(name,
"set-show-clones.1.1") == 0)
145 g_action_group_activate_action ((GActionGroup *)view -> action_group,
"set-show-clones.0.0", NULL);
153 state = g_action_get_state (G_ACTION (
action));
154 show = ! g_variant_get_boolean (state);
158 show = ! view -> anim -> last ->
img -> draw_clones;
160 view -> anim -> last ->
img -> draw_clones = show;
164 update_menu_bar (view);
167 g_variant_unref (state);
182 GMenu * menu = g_menu_new ();
183 append_opengl_item (view, menu,
"Show/Hide",
"show-clones", popm, popm, NULL,
IMG_NONE, NULL, FALSE,
184 G_CALLBACK(
show_hide_clones), (gpointer)view, TRUE, view -> anim -> last ->
img -> draw_clones, FALSE, (view -> allbonds[1]) ? TRUE : FALSE);
186 if (view -> anim -> last ->
img -> style !=
SPHERES && view -> anim -> last ->
img -> style !=
PUNT)
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
Global variable declarations Global convenience function declarations Global data structure defin...
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)
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
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
GtkWidget * menu_item_new_with_submenu(gchar *name, gboolean active, GtkWidget *sub_menu)
project * get_project_by_id(int p)
get project pointer using id number
void update(glwin *view)
update the rendering of the OpenGL window
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
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)
GMenu * menu_atoms(glwin *view, int popm, int at)
create the 'Atom(s)' submenu elements
GMenu * menu_bonds(glwin *view, int popm, int at)
create the 'Bond(s)' submenu GTK4
G_MODULE_EXPORT void show_hide_clones(GSimpleAction *action, GVariant *parameter, gpointer data)
show/hide clones menu item callback
GMenu * menu_clones(glwin *view, int popm)
create the 'Clone(s)' submenu GTK4