52extern G_MODULE_EXPORT
void axis_advanced (GSimpleAction *
action, GVariant * parameter, gpointer data);
54extern G_MODULE_EXPORT
void axis_advanced (GtkWidget * widg, gpointer data);
67G_MODULE_EXPORT
void set_axis_template_pos (GtkWidget * widg, gpointer data)
76 int i = this_proj -> modelgl -> anim -> last ->
img -> axispos;
77 int j = the_data ->
b;
78 if (gtk_check_menu_item_get_active ((GtkCheckMenuItem *)widg) && i != j)
80 this_proj -> modelgl -> anim -> last ->
img -> axispos =
NONE;
83 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_box_axis[1][8+i], FALSE);
85 if (widg != this_proj -> modelgl -> ogl_box_axis[1][8+j])
87 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_box_axis[1][8+j], TRUE);
89 this_proj -> modelgl -> anim -> last ->
img -> axispos =
j;
90 this_proj -> modelgl -> create_shaders[
MAXIS] = TRUE;
91 update (this_proj -> modelgl);
93 else if (i == j && ! gtk_check_menu_item_get_active ((GtkCheckMenuItem *)widg))
97 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_box_axis[1][8+i], TRUE);
113 GtkWidget * menup = gtk_menu_new ();
114 GtkWidget * ud, * udm, * widg;
115 gchar * udlab[2] = {
"Top",
"Bottom"};
116 gchar * lrlab[2] = {
"Right Corner",
"Left Corner"};
122 gtk_menu_shell_append ((GtkMenuShell *)menup, ud);
123 udm = gtk_menu_new ();
124 gtk_menu_item_set_submenu ((GtkMenuItem *)ud, udm);
130 FALSE, 0, 0, TRUE, TRUE, (view -> anim -> last ->
img -> axispos == i) ? TRUE: FALSE);
136 FALSE, 0, 0, TRUE, TRUE, (view -> anim -> last ->
img -> axispos == i) ? TRUE: FALSE);
145 FALSE, 0, 0, TRUE, TRUE, (view -> anim -> last ->
img -> axispos == i) ? TRUE: FALSE);
151 FALSE, 0, 0, TRUE, TRUE, (view -> anim -> last ->
img -> axispos == i) ? TRUE: FALSE);
169 gtk_menu_shell_append ((GtkMenuShell *)menu_ab, widg);
170 GtkWidget * menul = gtk_menu_new ();
171 gtk_menu_item_set_submenu ((GtkMenuItem *)widg, menul);
173 gchar * str = g_strdup_printf (
" Length [ %f Å ]", view -> anim -> last ->
img -> axis_length);
177 if (view -> anim -> last ->
img -> box_axis[
AXIS] ==
NONE)
185 if (view -> anim -> last ->
img -> box_axis[
AXIS] ==
NONE)
213 const gchar * pos = g_variant_get_string (parameter, NULL);
214 int lgt = strlen (pos);
215 gchar * name = g_strdup_printf (
"%c%c", pos[lgt-2], pos[lgt-1]);
216 if (g_strcmp0(name,
".1") == 0)
219 name = g_strdup_printf (
"%.*s.0", lgt-2, pos);
220 g_action_group_activate_action ((GActionGroup *)view -> action_group,
"set-axis-pos", g_variant_new_string((
const gchar *)name));
226 gchar * pos_name = NULL;
229 pos_name = g_strdup_printf (
"set-axis-pos.%d.0", i);
230 if (g_strcmp0(pos, (
const gchar *)pos_name) == 0)
232 view -> anim -> last ->
img -> axispos = i;
240 g_action_change_state (G_ACTION (
action), parameter);
241 view -> create_shaders[
MAXIS] = TRUE;
243 g_action_change_state (G_ACTION (
action), parameter);
258 GMenu * menu = g_menu_new ();
259 gchar * lrlab[2] = {
"Right Corner",
"Left Corner"};
264 append_opengl_item (view, menu, lrlab[j],
"axis-pos", popm, i, NULL,
IMG_NONE, NULL, FALSE,
266 FALSE, (view -> anim -> last ->
img -> axispos == i) ? TRUE: FALSE, TRUE, TRUE);
283 GMenu * menu = g_menu_new ();
284 gchar * udlab[2] = {
"Top",
"Bottom"};
289 append_opengl_item (view, menu,
"Center",
"axis-pos", popm, 4, NULL,
IMG_NONE, NULL, FALSE,
291 FALSE, (view -> anim -> last ->
img -> axispos == 4) ? TRUE: FALSE, TRUE, TRUE);
306 GMenuItem * item = g_menu_item_new (
"Length", (view -> anim -> last ->
img -> box_axis[
AXIS]) !=
NONE ? NULL :
"None");
307 g_menu_item_set_attribute (item,
"custom",
"s",
"axis-length", NULL);
309 g_menu_append_item (menu_ab, item);
311 append_opengl_item (view, menu_ab,
"Advanced",
"axis-advanced", popm, popm, NULL,
IMG_STOCK,
DPROPERTIES, FALSE,
312 G_CALLBACK(
axis_advanced), (gpointer)view, FALSE, FALSE, FALSE, 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 append_submenu(GMenu *menu, const gchar *label, GMenu *submenu)
append a GMenuItem with a subenu to a GMenu, and use markup for the GMenuItem
GtkWidget * add_advanced_item(GtkWidget *menu, GCallback handler, gpointer data, gboolean accel, guint key, GdkModifierType mod)
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
GtkWidget * create_menu_item(gboolean add_mnemo, gchar *action)
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 * position_submenu(glwin *view, int popm, int pos)
create elements of the 'Axis -> Position' submenu GTK4
GMenu * axis_position_submenu(glwin *view, int popm)
create the 'Axis -> Position' submenu GTK4
G_MODULE_EXPORT void axis_advanced(GtkWidget *widg, gpointer data)
create the axis advanced parameters window callback GTK3
GtkWidget * create_layout_widget(gchar *str, GtkWidget *menu, int vab, gpointer data)
G_MODULE_EXPORT void change_axis_pos_radio(GSimpleAction *action, GVariant *parameter, gpointer data)
handle change axis position signal GTK4
void menu_axis(GMenu *menu_ab, glwin *view, int popm)
create the 'Axis' submenu GTK4
GMenu * axis_box_param(glwin *view, int popm, int ab, int style)
create the box/axis '-> Length/Width/Radius' submenus GTK4