64extern GtkWidget * color_palette (
glwin * view,
int ideo,
int spec,
int geo);
65extern G_MODULE_EXPORT
void opengl_advanced (GtkWidget * widg, gpointer data);
66extern G_MODULE_EXPORT
void render_gl_image (GtkWidget * widg, gpointer data);
68extern G_MODULE_EXPORT
void view_shortcuts (GSimpleAction *
action, GVariant * parameter, gpointer data);
69GSimpleActionGroup * view_pop_actions;
80G_MODULE_EXPORT
void to_opengl_advanced (GSimpleAction *
action, GVariant * parameter, gpointer data)
94G_MODULE_EXPORT
void to_render_gl_image (GSimpleAction *
action, GVariant * parameter, gpointer data)
124void append_opengl_item (
glwin * view, GMenu * menu,
const gchar * name,
const gchar * key,
int mpop,
int item_id,
125 gchar * accel,
int image_format, gpointer icon,
126 gboolean custom, GCallback handler, gpointer data,
127 gboolean check, gboolean
status, gboolean radio, gboolean sensitive)
129 gchar * str_a, * str_b, * str_c;
130 str_a = g_strdup_printf (
"set-%s", key);
131 str_b = g_strdup_printf (
"%s.%d.%d", str_a, item_id, mpop);
132 str_c = (sensitive) ? g_strdup_printf (
"gl-%d.%s", view -> action_id, (radio) ? str_a : str_b) : g_strdup_printf (
"None");
133 append_menu_item (menu, name, (
const gchar *) str_c, accel, (custom) ? (
const gchar *) str_b : NULL, image_format, icon, check,
status, radio, (radio) ? (
const gchar *)str_b : NULL);
136 if (! radio || (radio &&
status))
140 widget_add_action (view -> action_group, (radio) ? (
const gchar *)str_a : (
const gchar *)str_b, handler, data,
141 check,
status, radio, (
const gchar *)str_b);
145 widget_add_action (view_pop_actions, (radio) ? (
const gchar *)str_a : (
const gchar *)str_b, handler, data,
146 check,
status, radio, (
const gchar *)str_b);
165 GMenu * menu = g_menu_new ();
167 GMenuItem * item = g_menu_item_new (_(
"Color Maps"), (
get_project_by_id(view ->
proj) -> nspec) ? NULL :
"None");
168 g_menu_item_set_submenu (item, (GMenuModel*)
menu_map(view, popm));
169 g_menu_append_item (menu, item);
170 append_opengl_item (view, menu, _(
"Material and Light(s)"),
"material", popm, popm, NULL,
IMG_NONE, NULL, FALSE, G_CALLBACK(to_opengl_advanced), (gpointer)view, FALSE, FALSE, FALSE, TRUE);
171 append_opengl_item (view, menu, _(
"Render Image"),
"image", popm, popm,
"<CTRL>I",
IMG_FILE,
PACKAGE_IMG, FALSE, G_CALLBACK(to_render_gl_image), (gpointer)view, FALSE, FALSE, FALSE, TRUE);
185 GMenu * menu = g_menu_new ();
203 GMenu * menu = g_menu_new ();
212 append_menu_item (menu, _(
"Ring(s)"),
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
220 append_menu_item (menu, _(
"Chain(s)"),
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
222 if (view -> adv_bonding[0])
228 append_menu_item (menu, _(
"Fragment(s)"),
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
230 if (view -> adv_bonding[1])
236 append_menu_item (menu, _(
"Molecule(s)"),
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
238 append_opengl_item (view, menu, _(
"Advanced"),
"adv-all", popm, popm,
"<CTRL>E",
IMG_STOCK, (gpointer)
DPROPERTIES, FALSE, G_CALLBACK(
to_coord_properties), & view ->
colorp[30][0], FALSE, FALSE, FALSE, TRUE);
252 GMenu * menu = g_menu_new ();
253 append_opengl_item (view, menu, _(
"Shortcuts"),
"shortcuts", popm, popm, NULL,
IMG_NONE, NULL, FALSE, G_CALLBACK(
view_shortcuts), (gpointer)view, FALSE, FALSE, FALSE, TRUE);
264GMenu * opengl_menu_bar (
glwin * view)
266 GMenu * menu = g_menu_new ();
275 append_menu_item (menu, _(
"Model"),
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
276 append_menu_item (menu, _(
"Chemistry"),
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
293void menu_bar_attach_color_palettes (
glwin * view, GtkWidget * menu_bar)
311 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, -1, -1, -1),
"set-box-color.0"))
313 g_debug (
"Color palette error: box - custom= set-box-color.0");
318 for (j=0;
j<this_proj -> nspec;
j++)
320 str = g_strdup_printf (
"set-%s.%d", (! i) ?
"atom-color" :
"clone-color", j);
321 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, i*this_proj -> nspec+j, -1, -1), (
const gchar *)str))
323 g_debug (
"Color palette error: %s - %d - custom= %s", (! i) ?
"atom-color" :
"clone-color", j+1, str);
331 if (this_proj -> coord -> ntg[i])
333 for (j=0;
j<this_proj -> nspec;
j++)
335 for (k=0;
k<this_proj -> coord -> ntg[
i][
j];
k++)
340 m += this_proj -> coord -> ntg[
i][
l];
344 env =
env_name (this_proj, k, j, 1, NULL);
345 str = g_strdup_printf (
"set-%s-c.%d",
exact_name (env), m);
350 str = g_strdup_printf (
"set-%d-c.%d", this_proj -> coord -> geolist[i][j][k], m);
352 m += (
i) ? this_proj -> coord -> totcoord[0] : 0;
353 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, 2*this_proj -> nspec+m, -1, -1), (
const gchar *)str))
355 g_debug (
"Color palette error: %s - spec= %d - coord= %d, custom= %s", (! i) ?
"total-coord" :
"partial-coord", j+1, k+1, str);
365 for (j=0;
j<this_proj -> coord -> totcoord[
i];
j++)
367 str = g_strdup_printf (
"set-%s-%d", (i == 2) ?
"fcol" :
"mcol", j);
368 k = 2*this_proj -> nspec + this_proj -> coord -> totcoord[0] + this_proj -> coord -> totcoord[1] +
j;
369 if (i == 3)
k += this_proj -> coord -> totcoord[2];
370 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, k, i, 0), (
const gchar *)str))
372 g_debug (
"Color palette error: %s - %d, custom= %s", (i == 2) ?
"fragment" :
"molecule", j+1, str);
380 for (j=0;
j<this_proj -> coord -> totcoord[
i];
j++)
382 str = g_strdup_printf (
"set-rcol-%d-%d", i, j);
383 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, -3, i-4, 0), (
const gchar *)str))
385 g_debug (
"Color palette error: rings - %d - %d, custom= %s", i, j+1, str);
391 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, -2, -1, -1),
"set-back-color.0"))
393 g_debug (
"Color palette error: background - custom= set-back-color.0");
404GtkWidget * opengl_window_create_menu_bar (
glwin * view)
407 if (view -> action_group) g_object_unref (view -> action_group);
408 view -> action_group = g_simple_action_group_new ();
411 GtkWidget * menu_bar = gtk_popover_menu_bar_new_from_model ((GMenuModel *)opengl_menu_bar(view));
412 menu_bar_attach_color_palettes (view, menu_bar);
413 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> menu_box, menu_bar, FALSE, FALSE, 0);
415 gchar * str = g_strdup_printf (
"gl-%d", view -> action_id);
416 gtk_widget_insert_action_group (view -> menu_box, str, G_ACTION_GROUP(view -> action_group));
429void update_menu_bar (
glwin * view)
431 view -> menu_bar = opengl_window_create_menu_bar (view);
Variable declarations for the MD input preparation assistants.
integer function chains()
Structure definitions for color management Function declarations for color management.
Global variable declarations Global convenience function declarations Global data structure defin...
void opengl_project_changed(int id)
change the OpenGL project
void widget_add_action(GSimpleActionGroup *action_group, const gchar *act, GCallback handler, gpointer data, gboolean check, gboolean status, gboolean radio, const gchar *stat)
add an action to an action group
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 add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void append_menu_item(GMenu *menu, const gchar *label, const gchar *action, const gchar *accel, const gchar *custom, int format, const gchar *icon, gboolean check, gboolean status, gboolean radio, const gchar *rstatus)
create a menu item, then append it to a menu
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
G_MODULE_EXPORT void opengl_advanced(GtkWidget *widg, gpointer data)
create OpenGL rendering advanced window
G_MODULE_EXPORT void view_shortcuts(GtkWidget *widg, gpointer data)
OpenGL window shortcuts callback GTK3.
G_MODULE_EXPORT void render_gl_image(GtkWidget *widg, gpointer data)
render image from 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)
Function declarations to handle the atomic coordination data.
gchar * env_name(project *this_proj, int g, int s, int f, GtkTextBuffer *buffer)
output the name of a coordination sphere
gchar * exact_name(gchar *name)
short cut to print string without spaces
Messaging function declarations.
GMenu * menu_anim(glwin *view, int popm)
create the 'Animate' submenu elements
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
GMenuItem * menu_box_axis(glwin *view, int popm, int ab)
create the 'Model -> Box' and 'View -> Axis' submenus GTK4
GMenu * menu_clones(glwin *view, int popm)
create the 'Clone(s)' submenu GTK4
GMenu * menu_coord(glwin *view, int popm)
create the 'Coordination' submenu GTK4
GMenu * menu_rings(glwin *view, int popm)
create the 'Ring(s)' submenu GTK4
G_MODULE_EXPORT void to_coord_properties(GSimpleAction *action, GVariant *parameter, gpointer data)
open advancedd coordination properties GTK4 callback
GMenu * add_menu_coord(glwin *view, int popm, int id)
create a coordination type submenu
GMenu * menu_map(glwin *view, int popm)
create the 'OpenGL -> Color Scheme(s)' submenu - GTK4
GMenu * menu_poly(glwin *view, int popm)
create the 'Chemistry -> Polyehdra' submenu - GTK4
GMenu * menu_view(glwin *view, int popm)
create the 'View' submenu - GTK4
GMenu * menu_style(glwin *view, int popm)
create the 'OpenGL -> Style' submenu - GTK4
Function declarations for reading atomes project file Function declarations for saving atomes proje...