56G_MODULE_EXPORT
void set_render (GtkWidget * widg, gpointer data)
60 int i = this_proj -> modelgl -> anim -> last ->
img ->
render;
61 int j = the_data ->
b;
63 if (i != j && gtk_check_menu_item_get_active ((GtkCheckMenuItem *)widg))
70 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_render[i], FALSE);
71 if (widg != this_proj -> modelgl -> ogl_render[j])
73 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_render[j], TRUE);
76 this_proj -> modelgl -> anim -> last ->
img ->
render = j;
77 this_proj -> modelgl -> create_shaders[
MAXIS] = TRUE;
78 update (this_proj -> modelgl);
81 else if (i == j && ! gtk_check_menu_item_get_active ((GtkCheckMenuItem *)widg))
83 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_render[j], TRUE);
100 GtkWidget * menur = gtk_menu_new ();
106 view -> ogl_render[
i] =
gtk3_menu_item (menur,
text_renders[i],
IMG_NONE, NULL, G_CALLBACK(
set_render), & view ->
colorp[i][0], FALSE, 0, 0, TRUE, TRUE, (i == j) ? TRUE : FALSE);
119 widg =
gtk3_menu_item (menur,
text_renders[i],
IMG_NONE, NULL, G_CALLBACK(
set_render), & view ->
colorp[i][0], FALSE, 0, 0, TRUE, TRUE, (i == j) ? TRUE : FALSE);
143 const gchar *
render = g_variant_get_string (parameter, NULL);
144 int lgt = strlen (
render);
145 gchar * name = g_strdup_printf (
"%c%c",
render[lgt-2],
render[lgt-1]);
146 if (g_strcmp0(name,
".1") == 0)
149 name = g_strdup_printf (
"%.*s.0", lgt-2,
render);
150 g_action_group_activate_action ((GActionGroup *)view -> action_group,
"set-render", g_variant_new_string((
const gchar *)name));
155 gchar * render_name = NULL;
159 render_name = g_strdup_printf (
"set-render.%d.0", i);
160 if (g_strcmp0(
render, (
const gchar *)render_name) == 0)
163 g_free (render_name);
167 g_free (render_name);
170 g_action_change_state (G_ACTION (
action), parameter);
185 GMenu * menu = g_menu_new ();
192 FALSE, (view -> anim -> last ->
img ->
render == i) ? TRUE : FALSE, TRUE, TRUE);
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 widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
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)
G_MODULE_EXPORT void change_render_radio(GSimpleAction *action, GVariant *parameter, gpointer data)
set OpenGL rendering mode callback GTK4
G_MODULE_EXPORT void set_render(GtkWidget *widg, gpointer data)
set OpenGL rendering mode callback
gchar * text_renders[OGL_RENDERS]
GMenu * menu_render(glwin *view, int popm)
create the 'OpenGL -> Render' submenu - GTK4