51extern G_MODULE_EXPORT
void axis_advanced (GtkWidget * widg, gpointer data);
64G_MODULE_EXPORT
void to_axis_advanced (GSimpleAction *
action, GVariant * parameter, gpointer data)
79G_MODULE_EXPORT
void set_axis_template_pos (GtkWidget * widg, gpointer data)
88 int i = this_proj -> modelgl -> anim -> last ->
img -> xyz -> t_pos;
89 int j = the_data ->
b;
90 if (gtk_check_menu_item_get_active ((GtkCheckMenuItem *)widg) && i != j)
92 this_proj -> modelgl -> anim -> last ->
img -> xyz -> t_pos =
NONE;
95 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_box_axis[1][8+i], FALSE);
97 if (widg != this_proj -> modelgl -> ogl_box_axis[1][8+j])
99 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_box_axis[1][8+j], TRUE);
101 this_proj -> modelgl -> anim -> last ->
img -> xyz -> t_pos =
j;
102 this_proj -> modelgl -> create_shaders[
MAXIS] = TRUE;
103 update (this_proj -> modelgl);
104 if (this_proj -> modelgl -> axis_win)
106 if (this_proj -> modelgl -> axis_win -> templates && GTK_IS_WIDGET(this_proj -> modelgl -> axis_win -> templates))
112 else if (i == j && ! gtk_check_menu_item_get_active ((GtkCheckMenuItem *)widg))
116 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_box_axis[1][8+i], TRUE);
132 GtkWidget * menup = gtk_menu_new ();
133 GtkWidget * ud, * udm, * widg;
134 gchar * udlab[2] = {
"Top",
"Bottom"};
135 gchar * lrlab[2] = {
"Right Corner",
"Left Corner"};
141 gtk_menu_shell_append ((GtkMenuShell *)menup, ud);
142 udm = gtk_menu_new ();
143 gtk_menu_item_set_submenu ((GtkMenuItem *)ud, udm);
149 FALSE, 0, 0, TRUE, TRUE, (view -> anim -> last ->
img -> xyz -> t_pos == i) ? TRUE: FALSE);
155 FALSE, 0, 0, TRUE, TRUE, (view -> anim -> last ->
img -> xyz -> t_pos == i) ? TRUE: FALSE);
164 FALSE, 0, 0, TRUE, TRUE, (view -> anim -> last ->
img -> xyz -> t_pos == i) ? TRUE: FALSE);
170 FALSE, 0, 0, TRUE, TRUE, (view -> anim -> last ->
img -> xyz -> t_pos == i) ? TRUE: FALSE);
188 gtk_menu_shell_append ((GtkMenuShell *)menu_ab, widg);
189 GtkWidget * menul = gtk_menu_new ();
190 gtk_menu_item_set_submenu ((GtkMenuItem *)widg, menul);
192 gchar * str = g_strdup_printf (
" Length [ %f Å ]", view -> anim -> last ->
img -> xyz -> length);
196 if (view -> anim -> last ->
img -> xyz ->
axis ==
NONE)
204 if (view -> anim -> last ->
img -> xyz ->
axis ==
NONE)
232 const gchar * pos = g_variant_get_string (parameter, NULL);
233 int lgt = strlen (pos);
234 gchar * name = g_strdup_printf (
"%c%c", pos[lgt-2], pos[lgt-1]);
235 if (g_strcmp0(name,
".1") == 0)
238 name = g_strdup_printf (
"%.*s.0", lgt-2, pos);
239 g_action_group_activate_action ((GActionGroup *)view -> action_group,
"set-axis-pos", g_variant_new_string((
const gchar *)name));
245 gchar * pos_name = NULL;
248 pos_name = g_strdup_printf (
"set-axis-pos.%d.0", i);
249 if (g_strcmp0(pos, (
const gchar *)pos_name) == 0)
251 view -> anim -> last ->
img -> xyz -> t_pos = i;
259 g_action_change_state (G_ACTION (
action), parameter);
260 view -> create_shaders[
MAXIS] = TRUE;
262 g_action_change_state (G_ACTION (
action), parameter);
263 if (view -> axis_win)
265 if (view -> axis_win -> templates && GTK_IS_WIDGET(view -> axis_win -> templates))
284 GMenu * menu = g_menu_new ();
285 gchar * lrlab[2] = {
"Right Corner",
"Left Corner"};
290 append_opengl_item (view, menu, lrlab[j],
"axis-pos", popm, i, NULL,
IMG_NONE, NULL, FALSE,
292 FALSE, (view -> anim -> last ->
img -> xyz -> t_pos == i) ? TRUE: FALSE, TRUE, TRUE);
309 GMenu * menu = g_menu_new ();
310 gchar * udlab[2] = {
"Top",
"Bottom"};
315 append_opengl_item (view, menu,
"Center",
"axis-pos", popm, 4, NULL,
IMG_NONE, NULL, FALSE,
317 FALSE, (view -> anim -> last ->
img -> xyz -> t_pos == 4) ? TRUE: FALSE, TRUE, TRUE);
332 GMenuItem * item = g_menu_item_new (
"Length", (view -> anim -> last ->
img -> xyz ->
axis) !=
NONE ? NULL :
"None");
333 g_menu_item_set_attribute (item,
"custom",
"s",
"axis-length", NULL);
335 g_menu_append_item (menu_ab, item);
337 append_opengl_item (view, menu_ab,
"Advanced",
"axis-advanced", popm, popm, NULL,
IMG_STOCK,
DPROPERTIES, FALSE,
338 G_CALLBACK(to_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 combo_set_active(GtkWidget *combo, int pos)
set the active item's position
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
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