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);
68GSimpleActionGroup * view_pop_actions;
79G_MODULE_EXPORT
void to_opengl_advanced (GSimpleAction *
action, GVariant * parameter, gpointer data)
93G_MODULE_EXPORT
void to_render_gl_image (GSimpleAction *
action, GVariant * parameter, gpointer data)
123void append_opengl_item (
glwin * view, GMenu * menu,
const gchar * name,
const gchar * key,
int mpop,
int item_id,
124 gchar * accel,
int image_format, gpointer icon,
125 gboolean custom, GCallback handler, gpointer data,
126 gboolean check, gboolean
status, gboolean radio, gboolean sensitive)
128 gchar * str_a, * str_b, * str_c;
129 str_a = g_strdup_printf (
"set-%s", key);
130 str_b = g_strdup_printf (
"%s.%d.%d", str_a, item_id, mpop);
131 str_c = (sensitive) ? g_strdup_printf (
"gl-%d.%s", view -> action_id, (radio) ? str_a : str_b) : g_strdup_printf (
"None");
132 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);
135 if (! radio || (radio &&
status))
139 widget_add_action (view -> action_group, (radio) ? (
const gchar *)str_a : (const gchar *)str_b, handler, data,
140 check,
status, radio, (const gchar *)str_b);
144 widget_add_action (view_pop_actions, (radio) ? (
const gchar *)str_a : (const gchar *)str_b, handler, data,
145 check,
status, radio, (const gchar *)str_b);
164 GMenu * menu = g_menu_new ();
166 GMenuItem * item = g_menu_item_new (
"Color Scheme(s)", (
get_project_by_id(view ->
proj) -> nspec) ? NULL :
"None");
167 g_menu_item_set_submenu (item, (GMenuModel*)
menu_map(view, popm));
168 g_menu_append_item (menu, item);
171 append_opengl_item (view, menu,
"Material And Lights",
"material", popm, popm, NULL,
IMG_NONE, NULL, FALSE, G_CALLBACK(to_opengl_advanced), (gpointer)view, FALSE, FALSE, FALSE, TRUE);
172 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);
186 GMenu * menu = g_menu_new ();
204 GMenu * menu = g_menu_new ();
213 append_menu_item (menu,
"Ring(s)",
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
221 append_menu_item (menu,
"Chain(s)",
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
223 if (view -> adv_bonding[0])
229 append_menu_item (menu,
"Fragment(s)",
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
231 if (view -> adv_bonding[1])
237 append_menu_item (menu,
"Molecule(s)",
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
239 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);
250GMenu * opengl_menu_bar (
glwin * view)
252 GMenu * menu = g_menu_new ();
261 append_menu_item (menu,
"Model",
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
262 append_menu_item (menu,
"Chemistry",
"None", NULL, NULL,
IMG_NONE, NULL, FALSE, FALSE, FALSE, NULL);
278void menu_bar_attach_color_palettes (
glwin * view, GtkWidget * menu_bar)
296 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, -1, -1, -1),
"set-box-color.0"))
298 g_debug (
"Color palette error: box - custom= set-box-color.0");
303 for (j=0;
j<this_proj -> nspec;
j++)
305 str = g_strdup_printf (
"set-%s.%d", (! i) ?
"atom-color" :
"clone-color",
j);
306 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, i*this_proj -> nspec+j, -1, -1), (
const gchar *)str))
308 g_debug (
"Color palette error: %s - %d - custom= %s", (! i) ?
"atom-color" :
"clone-color",
j+1, str);
316 if (this_proj -> coord -> ntg[i])
318 for (j=0;
j<this_proj -> nspec;
j++)
320 for (k=0;
k<this_proj -> coord -> ntg[
i][
j];
k++)
325 m += this_proj -> coord -> ntg[
i][
l];
329 str = g_strdup_printf (
"set-%s-c.%d",
exact_name (
env_name (this_proj, k, j, 1, NULL)), m);
333 str = g_strdup_printf (
"set-%d-c.%d", this_proj -> coord -> geolist[i][j][k], m);
335 m += (
i) ? this_proj -> coord -> totcoord[0] : 0;
336 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, 2*this_proj -> nspec+m, -1, -1), (
const gchar *)str))
338 g_debug (
"Color palette error: %s - spec= %d - coord= %d, custom= %s", (! i) ?
"total-coord" :
"partial-coord",
j+1,
k+1, str);
348 for (j=0;
j<this_proj -> coord -> totcoord[
i];
j++)
350 str = g_strdup_printf (
"set-%s-%d", (i == 2) ?
"fcol" :
"mcol",
j);
351 k = 2*this_proj -> nspec + this_proj -> coord -> totcoord[0] + this_proj -> coord -> totcoord[1] +
j;
352 if (i == 3)
k += this_proj -> coord -> totcoord[2];
353 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, k, i, 0), (
const gchar *)str))
355 g_debug (
"Color palette error: %s - %d, custom= %s", (i == 2) ?
"fragment" :
"molecule",
j+1, str);
363 for (j=0;
j<this_proj -> coord -> totcoord[
i];
j++)
365 str = g_strdup_printf (
"set-rcol-%d-%d", i, j);
366 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, -3, i-4, 0), (
const gchar *)str))
368 g_debug (
"Color palette error: rings - %d - %d, custom= %s", i, j+1, str);
374 if (! gtk_popover_menu_bar_add_child ((GtkPopoverMenuBar *)menu_bar, color_palette (view, -2, -1, -1),
"set-back-color.0"))
376 g_debug (
"Color palette error: background - custom= set-back-color.0");
387GtkWidget * opengl_window_create_menu_bar (
glwin * view)
390 if (view -> action_group) g_object_unref (view -> action_group);
391 view -> action_group = g_simple_action_group_new ();
394 GtkWidget * menu_bar = gtk_popover_menu_bar_new_from_model ((GMenuModel *)opengl_menu_bar(view));
395 menu_bar_attach_color_palettes (view, menu_bar);
397 gchar * str = g_strdup_printf (
"gl-%d", view -> action_id);
398 gtk_widget_insert_action_group (menu_bar, str, G_ACTION_GROUP(view -> action_group));
402 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> menu_box, menu_bar, FALSE, FALSE, 0);
415void update_menu_bar (
glwin * view)
417 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 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)
ouput 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_quality(glwin *view, int popm)
create the 'OpenGL -> Quality' menu item - GTK4
GMenu * menu_render(glwin *view, int popm)
create the 'OpenGL -> Render' 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...