72extern G_MODULE_EXPORT
void opengl_advanced (GtkWidget * widg, gpointer data);
73extern G_MODULE_EXPORT
void coord_properties (GtkWidget * widg, gpointer data);
74extern G_MODULE_EXPORT
void set_style (GtkWidget * widg, gpointer data);
75extern G_MODULE_EXPORT
void set_render (GtkWidget * widg, gpointer data);
76extern G_MODULE_EXPORT
void set_mode (GtkWidget * widg, gpointer data);
81extern gboolean
spin (gpointer data);
82extern G_MODULE_EXPORT
void spin_stop (GtkButton * but, gpointer data);
83extern G_MODULE_EXPORT
void spin_go (GtkWidget * widg, gpointer data);
86extern G_MODULE_EXPORT
void window_measures (GtkWidget * widg, gpointer data);
87extern G_MODULE_EXPORT
void window_recorder (GtkWidget * widg, gpointer data);
89extern GtkWidget *
menupoly (
glwin * view,
int jd,
int id, gchar * poln);
90extern G_MODULE_EXPORT
void set_color_map (GtkWidget * widg, gpointer data);
92extern void update_menu_bar (
glwin * view);
93extern G_MODULE_EXPORT
void set_full_screen (GSimpleAction *
action, GVariant * parameter, gpointer data);
94extern G_MODULE_EXPORT
void add_object (GSimpleAction *
action, GVariant * parameter, gpointer data);
99extern G_MODULE_EXPORT
void copy_the_atoms (GSimpleAction *
action, GVariant * parameter, gpointer data);
102extern G_MODULE_EXPORT
void set_full_screen (GtkWidget * widg, gpointer data);
103extern G_MODULE_EXPORT
void to_reset_view (GtkWidget * widg, gpointer data);
104extern G_MODULE_EXPORT
void add_object (GtkWidget * widg, gpointer data);
107extern G_MODULE_EXPORT
void remove_the_atoms (GtkWidget * widg, gpointer data);
108extern G_MODULE_EXPORT
void copy_the_atoms (GtkWidget * widg, gpointer data);
159 if (view -> ogl_poly[0][j] != NULL)
163 if (view -> ogl_poly[0][j][k] != NULL)
165 if (GTK_IS_WIDGET(view -> ogl_poly[0][j][k]))
167 widg = gtk_widget_get_parent (view -> ogl_poly[0][j][k]);
168 if (GTK_IS_WIDGET(widg))
170 g_object_ref (view -> ogl_poly[0][j][k]);
171 gtk_container_remove (GTK_CONTAINER(widg), view -> ogl_poly[0][j][k]);
178 if (view -> ogl_geom[0][j] != NULL)
182 if (view -> ogl_geom[0][j][k] != NULL)
184 if (GTK_IS_WIDGET(view -> ogl_geom[0][j][k]))
186 widg = gtk_widget_get_parent (view -> ogl_geom[0][j][k]);
187 if (GTK_IS_WIDGET(widg))
189 g_object_ref (view -> ogl_geom[0][j][k]);
190 gtk_container_remove (GTK_CONTAINER(widg), view -> ogl_geom[0][j][k]);
197 if (view -> ogl_chains[0]) view -> ogl_chains[0] =
destroy_this_widget (view -> ogl_chains[0]);
202 detach_frag_mol_menu (view, i, j);
218 GtkWidget * menu = gtk_menu_new ();
219 gtk_menu_shell_append ((GtkMenuShell *)menu, view -> ogl_coord[1]);
220 gtk_menu_shell_append ((GtkMenuShell *)menu, view -> ogl_coord[2]);
221 gtk_menu_shell_append ((GtkMenuShell *)menu, view -> ogl_rings[0]);
222 gtk_menu_shell_append ((GtkMenuShell *)menu, view -> ogl_chains[0]);
223 gtk_menu_shell_append ((GtkMenuShell *)menu, view -> ogl_coord[3]);
224 gtk_menu_shell_append ((GtkMenuShell *)menu, view -> ogl_coord[4]);
225 gtk3_menu_item (menu,
"Advanced",
IMG_NONE, NULL, G_CALLBACK(
coord_properties), (gpointer)& view ->
colorp[30][0], TRUE, GDK_KEY_e, GDK_CONTROL_MASK, FALSE, FALSE, FALSE);
243 i = view -> anim -> last ->
img -> style;
247 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_styles[j], FALSE);
250 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_styles[i], TRUE);
255 i = view -> anim -> last ->
img -> filled_type;
256 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> filled_styles[i], TRUE);
260 i = view -> anim -> last ->
img ->
render;
264 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_render[j], FALSE);
265 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_render[i], TRUE);
273 if (view -> anim -> last ->
img -> box_axis[i] ==
NONE)
275 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[i][0], FALSE);
280 j = (view -> anim -> last ->
img -> box_axis[i] ==
WIREFRAME) ? 1 : 2;
283 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[i][0], TRUE);
285 view -> anim -> last ->
img -> box_axis[i] = l;
286 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[i][j], TRUE);
290 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_rep[view -> anim -> last ->
img ->
rep], TRUE);
291 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_rep[! view -> anim -> last ->
img ->
rep], FALSE);
292 for (i=0; i<5; i++) gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[1][8+i], FALSE);
293 if (view -> anim -> last ->
img -> axispos !=
CUSTOM)
295 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[1][8+view -> anim -> last ->
img -> axispos], TRUE);
301 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_clones[0], view -> anim -> last ->
img -> draw_clones);
302 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_clones[5], view -> anim -> last ->
img ->
cloned_poly);
305 if (view -> color_styles[0])
307 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> color_styles[0], TRUE);
312 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> color_styles[
ATOM_MAPS], TRUE);
317 gtk_range_set_value (GTK_RANGE(view -> ogl_quality), view -> anim -> last ->
img -> quality);
319 update_menu_bar (view);
348void menu_items_opengl (GtkWidget * menu,
glwin * view,
int pop)
350 GtkWidget * style =
gtk3_menu_item (menu,
"Style",
IMG_FILE, (gpointer)PACKAGE_MOL, NULL, NULL, FALSE, 0, 0, FALSE, FALSE,
get_project_by_id(view ->
proj) -> nspec);
351 gtk_menu_item_set_submenu ((GtkMenuItem *)style,
menu_style(view,
pop));
355 gtk3_menu_item (menu,
"Material And Light(s)",
IMG_NONE, NULL, G_CALLBACK(
opengl_advanced), (gpointer)view, FALSE, 0, 0, FALSE, FALSE, FALSE);
356 gtk3_menu_item (menu,
"Render Image",
IMG_FILE, (gpointer)PACKAGE_IMG, G_CALLBACK(
render_gl_image), (gpointer)view, FALSE, 0, 0, FALSE, FALSE, FALSE);
367GtkWidget * menu_opengl (
glwin * view,
int pop)
369 GtkWidget * menu = gtk_menu_new ();
370 menu_items_opengl (menu, view,
pop);
383void menu_items_model (GtkWidget * menu,
glwin * view,
int pop)
390 gtk_menu_shell_append ((GtkMenuShell *)menu,
menu_box_axis (view, 0, 0));
402GtkWidget * menu_model (
glwin * view,
int pop)
404 GtkWidget * menu = gtk_menu_new ();
405 menu_items_model (menu, view,
pop);
427 gtk3_menu_item (menu,
"Reset view",
IMG_STOCK, (gpointer)
FITBEST, G_CALLBACK(
to_reset_view), (gpointer)view, FALSE, 0, 0, FALSE, FALSE, FALSE);
428 gtk3_menu_item (menu,
"Center molecule",
IMG_STOCK, (gpointer)
FITBEST, G_CALLBACK(
to_center_this_molecule), (gpointer)view, FALSE, 0, 0, FALSE, FALSE, FALSE);
430 gtk3_menu_item (menu,
"Fullscreen",
IMG_STOCK, (gpointer)
FULLSCREEN, G_CALLBACK(
set_full_screen), (gpointer)view, TRUE, GDK_KEY_f, GDK_CONTROL_MASK, FALSE, FALSE, FALSE);
444 GtkWidget * menu = gtk_menu_new ();
464 view -> menu_bar = gtk_menu_bar_new ();
467 gtk_menu_shell_append ((GtkMenuShell *)view -> menu_bar,
menu_item_new_with_submenu (
"Model", this_proj -> nspec, menu_model(view, 0)));
469 gtk_menu_shell_append ((GtkMenuShell *)view -> menu_bar, view -> ogl_coord[0]);
471 if (this_proj -> nspec)
473 gtk_menu_item_set_submenu ((GtkMenuItem *)view -> ogl_coord[0],
coord_menu (view));
477 gtk_menu_shell_append ((GtkMenuShell *)view -> menu_bar,
menu_anim (view, 0));
481 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> menu_box, view -> menu_bar, TRUE, TRUE, 0);
484 update_menu_bar (view);
500 if (view -> custom_map) i++;
501 if (view -> anim -> last ->
img -> color_map[
col] < i-1)
503 if (view -> anim -> last ->
img -> color_map[
col] < 2)
507 else if (view -> anim -> last ->
img -> color_map[
col] == 2 && view -> adv_bonding[0])
511 else if (view -> anim -> last ->
img -> color_map[
col] == 3 && view -> adv_bonding[1])
531 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> color_styles[j], TRUE);
534 gchar * variant = g_strdup_printf (
"set-%s.%d.0", (
col) ?
"pmap" :
"amap", j);
535 g_action_group_activate_action ((GActionGroup *)view -> action_group, (
col) ?
"set-pmap" :
"set-amap", g_variant_new_string((
const gchar *)variant));
555 if (state & GDK_CONTROL_MASK)
562 trans = vec3(view -> anim -> last ->
img -> p_depth*(
double) da / view -> pixels[
axis], 0.0, 0.0);
566 trans = vec3(0.0, view -> anim -> last ->
img -> p_depth*(
double) da / view -> pixels[
axis], 0.0);
572 else if (state & GDK_SHIFT_MASK)
578 view -> anim -> last ->
img -> c_shift[!
axis] += (double) da / view -> pixels[
axis];
579 if (view -> camera_widg[!
axis + 5])
581 if (GTK_IS_WIDGET(view -> camera_widg[!
axis + 5]))
583 gtk_spin_button_set_value ((GtkSpinButton *)view -> camera_widg[!
axis + 5], - view -> anim -> last ->
img -> c_shift[!
axis]);
589 else if ((state & GDK_SHIFT_MASK) && UpDown)
592 if (db == 3)
zoom (view, 1);
595 else if (state != GDK_SHIFT_MASK)
598 double cameraAngle[2] = {0.0, 0.0};
599 cameraAngle[
axis] = 0.5*da;
600 rotate_x_y (view, cameraAngle[0], cameraAngle[1]);
616 double gleft, gright, gbottom, gtop;
618 zoom *= (view -> anim -> last ->
img -> p_depth / view -> anim -> last ->
img -> gnear);
619 dw = view -> anim -> last ->
img -> c_shift[0]*2.0*
zoom;
620 dh = view -> anim -> last ->
img -> c_shift[1]*2.0*
zoom;
621 double aspect = (double)view -> pixels[0] / (
double)view -> pixels[1];
636 return m4_ortho (gleft, gright, gbottom, gtop, -view -> anim -> last ->
img -> gfar, view -> anim -> last ->
img -> gfar);
650 insert_pmv_matrix = m4_mul (
insert_projection (view), view -> model_view_matrix);
651 pos = vec3 (view -> mouseX, view -> mouseY, 0.75);
652 return v3_un_project (pos, view -> view_port, insert_pmv_matrix);
666 GVariant * action_state = g_variant_new_string (action_string);
667 g_action_group_activate_action ((GActionGroup *)view -> action_group,
action_name, action_state);
687 if (view -> fullscreen)
712 if (view ->
spin[0] || view ->
spin[1])
716 view ->
spin[i+2] = view ->
spin[i];
717 view -> spin_speed[i+2] = view -> spin_speed[i];
718 view ->
spin[i] = FALSE;
721 else if (view ->
spin[2] || view ->
spin[3])
725 view ->
spin[i] = view ->
spin[i+2];
726 view -> spin_speed[i] = view -> spin_speed[i+2];
728 view ->
spin[i+2] = FALSE;
729 view -> spin_speed[i+2] = 0;
740 if (view -> anim -> last ->
img -> selected[i] -> selected ==
opengl_project -> natomes)
758 else if (state & GDK_ALT_MASK)
760 else if (state & GDK_MOD1_MASK)
769 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_mode[0], TRUE);
788 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_smode[0], TRUE);
800 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_styles[
BALL_AND_STICK], TRUE);
809 if (state & GDK_CONTROL_MASK)
811 if (view -> anim -> last ->
img -> selected[0] -> selected)
816 view -> nth_copy = 1;
840 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_styles[
CYLINDERS], TRUE);
854 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_smode[1], TRUE);
866 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_styles[
PUNT], TRUE);
874 if (state & GDK_CONTROL_MASK)
879 else if (state & GDK_ALT_MASK)
881 else if (state & GDK_MOD1_MASK)
890 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_mode[1], TRUE);
912 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_smode[2], TRUE);
924 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> filled_styles[1], TRUE);
955 if (state & GDK_CONTROL_MASK)
957 view -> anim -> last ->
img -> m_is_pressed = 0;
960 else if (view -> anim -> last ->
img -> m_is_pressed < 2)
962 view -> anim -> last ->
img -> m_is_pressed ++;
966 view -> anim -> last ->
img -> m_is_pressed = 0;
968 view -> create_shaders[
MEASU] = TRUE;
980 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_smode[3], TRUE);
995 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> filled_styles[0], TRUE);
1006 if (state & GDK_CONTROL_MASK)
1016 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> filled_styles[3], TRUE);
1027 if (state & GDK_CONTROL_MASK)
1037 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_styles[
SPHERES], TRUE);
1044 if (state & GDK_CONTROL_MASK)
1055 view -> nth_copy ++;
1074 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> filled_styles[2], TRUE);
1086 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_styles[
WIREFRAME], TRUE);
1096 if (view -> anim -> last ->
img -> selected[0] -> selected)
1137G_MODULE_EXPORT gboolean on_key_pressed (GtkWidget * widg, GdkEventKey * event, gpointer data)
1139 if (event -> type == GDK_KEY_PRESS)
1157G_MODULE_EXPORT gboolean
on_glwin_key_pressed (GtkEventControllerKey * self, guint keyval, guint keycode, GdkModifierType state, gpointer data)
1177 if (GTK_IS_WIDGET(view -> menu_bar))
shift = gtk_widget_get_allocated_height (view -> menu_bar);
1178 if (
pix[0] > 0 &&
pix[1] > 0)
1198void gtk_window_change_gdk_visual (GtkWidget * win)
1204 GdkScreen * screen = gdk_screen_get_default ();
1205 GList * visuals = gdk_screen_list_visuals (screen);
1207 GdkX11Screen* x11_screen = GDK_X11_SCREEN (screen);
1208 g_assert (x11_screen != NULL);
1209 Visual * default_xvisual = DefaultVisual (GDK_SCREEN_XDISPLAY(x11_screen), GDK_SCREEN_XNUMBER(x11_screen));
1210 GdkVisual * default_visual = NULL;
1212 while (visuals != NULL)
1214 GdkVisual * visual = GDK_X11_VISUAL (visuals -> data);
1215 if (default_xvisual -> visualid == gdk_x11_visual_get_xvisual(GDK_X11_VISUAL (visuals -> data)) -> visualid)
1218 default_visual = visual;
1221 visuals = visuals -> next;
1223 gtk_widget_set_visual (win, default_visual);
1232 if (! glXQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), NULL, NULL))
1234 g_warning (
"Sorry OpenGL is not supported !");
1240 if (this_proj -> modelgl)
1242 g_free (this_proj -> modelgl);
1243 this_proj -> modelgl = NULL;
1245 this_proj -> modelgl = g_malloc0 (
sizeof*this_proj -> modelgl);
1246 this_proj -> modelgl -> init = FALSE;
1247 this_proj -> modelgl ->
proj = this_proj -> id;
1248 GtkWidget * gl_vbox;
1251 gchar * str = g_strdup_printf (
"%s - 3D view - [%s mode]", this_proj -> name,
mode_name[0]);
1256 if (!
atomes_visual) gtk_window_change_gdk_visual (this_proj -> modelgl -> win);
1265 this_proj -> modelgl -> menu_box =
create_hbox (0);
1266 add_box_child_start (GTK_ORIENTATION_VERTICAL, gl_vbox, this_proj -> modelgl -> menu_box, FALSE, FALSE, 0);
1268 this_proj -> modelgl -> menu_bar = gtk_menu_bar_new ();
1269 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, this_proj -> modelgl -> menu_box, this_proj -> modelgl -> menu_bar, TRUE, TRUE, 0);
1273 this_proj -> modelgl ->
plot = gtk_gl_area_new ();
1275 this_proj -> modelgl ->
plot = gtk_drawing_area_new ();
1277 gtk_widget_set_size_request (this_proj -> modelgl ->
plot, 100, 100);
1279 gtk_widget_set_double_buffered (this_proj -> modelgl ->
plot, FALSE);
1280 this_proj -> modelgl ->
glcontext = NULL;
1282 gtk_widget_set_hexpand (this_proj -> modelgl ->
plot, TRUE);
1283 gtk_widget_set_vexpand (this_proj -> modelgl ->
plot, TRUE);
1286 gtk_widget_add_events (GTK_WIDGET (this_proj -> modelgl ->
plot),
1288 GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK |
1289 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
1292 gtk_widget_add_events (GTK_WIDGET (this_proj -> modelgl ->
plot),
1293 GDK_SMOOTH_SCROLL_MASK |
1294 GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK |
1295 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
1300 add_widget_gesture_and_key_action (this_proj -> modelgl -> win, NULL, NULL, NULL,
1305 add_widget_gesture_and_key_action (this_proj -> modelgl ->
plot,
"glwin-button-pressed", G_CALLBACK(
on_glwin_button_pressed), this_proj -> modelgl,
1313 add_widget_gesture_and_key_action (this_proj -> modelgl ->
plot,
"glwin-button-pressed", G_CALLBACK(
on_lib_button_pressed), this_proj -> modelgl,
1321 g_signal_connect (G_OBJECT (this_proj -> modelgl ->
plot),
"motion-notify-event", G_CALLBACK(on_motion), this_proj -> modelgl);
1322 g_signal_connect (G_OBJECT (this_proj -> modelgl ->
plot),
"button-release-event", G_CALLBACK(on_glwin_button_event), this_proj -> modelgl);
1325 g_signal_connect (G_OBJECT (this_proj -> modelgl ->
plot),
"button-press-event", G_CALLBACK(on_glwin_button_event), this_proj -> modelgl);
1326 g_signal_connect (G_OBJECT (this_proj -> modelgl ->
plot),
"scroll-event", G_CALLBACK(on_scrolled), this_proj -> modelgl);
1330 g_signal_connect (G_OBJECT (this_proj -> modelgl ->
plot),
"button-press-event", G_CALLBACK(on_lib_pressed), this_proj -> modelgl);
1337 g_signal_connect (G_OBJECT (this_proj -> modelgl -> win),
"key-press-event", G_CALLBACK(on_key_pressed), this_proj -> modelgl);
1339 g_signal_connect (G_OBJECT (this_proj -> modelgl -> win),
"realize", G_CALLBACK(
on_win_realize), this_proj -> modelgl);
1342 g_signal_connect (G_OBJECT (this_proj -> modelgl ->
plot),
"realize", G_CALLBACK(
on_realize), this_proj -> modelgl);
1344 g_signal_connect (G_OBJECT (this_proj -> modelgl ->
plot),
"render", G_CALLBACK(
on_expose), this_proj -> modelgl);
1346 g_signal_connect (G_OBJECT (this_proj -> modelgl ->
plot),
"draw", G_CALLBACK(
on_expose), this_proj -> modelgl);
1362 gboolean rendering = FALSE;
1363 gboolean adv_bonding[2];
1364 if (this_proj -> modelgl == NULL)
1379 this_proj -> modelgl -> menu_bar =
destroy_this_widget (this_proj -> modelgl -> menu_bar);
1390 this_proj -> modelgl -> menu_bar =
destroy_this_widget (this_proj -> modelgl -> menu_bar);
1400 if (this_proj -> initgl)
1420 adv_bonding[0] = adv_bonding[1] = TRUE;
1422 if (
active_project -> natomes && adv_bonding[0] && adv_bonding[1])
1433 if (gtk_widget_get_visible(this_proj -> modelgl -> win))
1435 gtk_widget_hide (this_proj -> modelgl -> win);
1439 gtk_widget_show (this_proj -> modelgl -> win);
GtkWidget * coord_menu(glwin *view)
void restore_color_map(glwin *view, int *colm)
restore saved color maps
int * save_color_map(glwin *view)
save atoms and polyhedra color maps
Variable declarations for the MD input preparation assistants.
integer function chains()
void update_insert_combos()
update some GtkComboBox in the workspace if a project is removed
Structure definitions for color management Function declarations for color management.
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
gboolean tmp_adv_bonding[2]
Global variable declarations Global convenience function declarations Global data structure defin...
void update_chains_menus(glwin *view)
#define ATOM_LIMIT
Atom number limit to compute fragment(s) and molecule(s) analysis automatically.
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)
gboolean is_atom_win_active(glwin *view)
is the model edition window visible ?
void resize_this_window(GtkWidget *window, int x, int y)
resize this GtkWindow
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
void opengl_project_changed(int id)
change the OpenGL project
G_MODULE_EXPORT gboolean hide_this_window(GtkWidget *win, GdkEvent *event, gpointer data)
hide a GtkWindow
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
G_MODULE_EXPORT void on_calc_bonds_released(GtkWidget *widg, gpointer data)
compute bonding properties
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.
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
GtkWidget * create_menu_item(gboolean add_mnemo, gchar *action)
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
void add_menu_separator(GtkWidget *menu)
GtkWidget * menu_item_new_with_submenu(gchar *name, gboolean active, GtkWidget *sub_menu)
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
void update_rings_menus(glwin *view)
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
G_MODULE_EXPORT void on_realize(GtkWidget *widg, gpointer data)
realize event for the OpenGL widget
G_MODULE_EXPORT void on_glwin_pointer_motion(GtkEventControllerMotion *motc, gdouble x, gdouble y, gpointer data)
handle mouse motion event in the OpenGL window GTK4
void update(glwin *view)
update the rendering of the OpenGL window
G_MODULE_EXPORT void on_lib_button_released(GtkGesture *gesture, int n_press, double x, double y, gpointer data)
handle mouse button release event on the molecular library OpenGL window (limited interaction)
void zoom(glwin *view, int delta)
zoom in or zoom out in the OpenGL window
G_MODULE_EXPORT void on_lib_button_pressed(GtkGesture *gesture, int n_press, double x, double y, gpointer data)
handle mouse button press event on the molecular library OpenGL window (limited interaction)
G_MODULE_EXPORT void on_glwin_button_released(GtkGesture *gesture, int n_press, double x, double y, gpointer data)
mouse button released signal on the OpenGL window
G_MODULE_EXPORT void on_glwin_button_pressed(GtkGesture *gesture, int n_press, double x, double y, gpointer data)
mouse button pressed signal on the OpenGL window
G_MODULE_EXPORT gboolean on_glwin_pointer_scoll(GtkEventControllerScroll *event, gdouble dx, gdouble dy, gpointer data)
handle mouse scroll event on the OpenGL window
G_MODULE_EXPORT gboolean on_expose(GtkWidget *widg, cairo_t *cr, gpointer data)
OpenGL rendering widget expose event callback GTK3.
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
#define ZOOM_MAX
Maximum value for the OpenGL zoom factor.
G_MODULE_EXPORT void to_center_this_molecule(GtkWidget *widg, gpointer data)
center this molecule menu item callback GTK4
#define REFRESH
Refresh time for spinning the OpenGL window in milliseconds.
#define DEFAULT_STYLE
Default OpenGL style: ball and stick.
void activate_glwin_action(gchar *action_string, gchar *action_name, glwin *view)
the keyboard shortcut actions for the OpenGL window
void set_sensitive_coord_menu(glwin *view, gboolean status)
void glwin_key_pressed(guint keyval, GdkModifierType state, gpointer data)
the keyboard shortcut actions for the OpenGL window
void set_color_map_sensitive(glwin *view)
void window_encode(glwin *view, gboolean video)
encoding a movie - creating the dialog
G_MODULE_EXPORT void coord_properties(GtkWidget *widg, gpointer data)
create the environments configuration window
G_MODULE_EXPORT void set_style(GtkWidget *widg, gpointer data)
set style callback
int get_selection_type(glwin *view)
get selection type
void save_rotation_quaternion(glwin *view)
save the rotation quaternion of the last image
G_MODULE_EXPORT void set_selection_mode(GtkWidget *widg, gpointer data)
set selection mode callback
void update_all_menus(glwin *view, int nats)
update all menus of the OpenGL window
void prep_model(int p)
prepare, or display, the OpenGL model window
G_MODULE_EXPORT void opengl_advanced(GtkWidget *widg, gpointer data)
create OpenGL rendering advanced window
G_MODULE_EXPORT gboolean on_glwin_key_pressed(GtkEventControllerKey *self, guint keyval, guint keycode, GdkModifierType state, gpointer data)
keyboard key press event for the OpenGL window GTK4
G_MODULE_EXPORT void spin_go(GtkWidget *widg, gpointer data)
void update_menus(glwin *view)
G_MODULE_EXPORT void set_box_axis_style(GtkWidget *widg, gpointer data)
G_MODULE_EXPORT void on_win_realize(GtkWidget *widg, gpointer data)
realize event for the OpenGL window
G_MODULE_EXPORT void set_render(GtkWidget *widg, gpointer data)
set OpenGL rendering mode callback
G_MODULE_EXPORT void set_full_screen(GtkWidget *widg, gpointer data)
set full screen callback GTK3
G_MODULE_EXPORT void add_object(GtkWidget *widg, gpointer data)
add object call back GTK3
void prep_all_coord_menus(glwin *view)
G_MODULE_EXPORT void copy_the_atoms(GtkWidget *widg, gpointer data)
copy selected atom(s) callback GTK3
void prepare_opengl_menu_bar(glwin *view)
update the OpenGL window menu bar
G_MODULE_EXPORT void label_unlabel_atoms(GtkWidget *widg, gpointer data)
label / unlabel a type of atom(s) callback GTK3
G_MODULE_EXPORT void window_recorder(GtkWidget *widg, gpointer data)
create video recorder window
void translate(project *this_proj, int status, int axis, vec3_t trans)
translate
gboolean spin(gpointer data)
spin
GtkWidget * menupoly(glwin *view, int jd, int id, gchar *poln)
G_MODULE_EXPORT void select_unselect_atoms(GtkWidget *widg, gpointer data)
select / unselect a type of atom(s) callback GTK3
void change_color_map(glwin *view, int col)
change atom / polyhedra color map
gboolean create_3d_model(int p, gboolean load)
G_MODULE_EXPORT void to_reset_view(GtkWidget *widg, gpointer data)
reset view callback - GTK3
G_MODULE_EXPORT void window_measures(GtkWidget *widg, gpointer data)
create the measurements window
G_MODULE_EXPORT void render_gl_image(GtkWidget *widg, gpointer data)
render image from the OpenGL window
G_MODULE_EXPORT void set_mode(GtkWidget *widg, gpointer data)
set mouse mode callback
vec3_t get_insertion_coordinates(glwin *view)
get the insertion coordinates to insert object in the 3D window
G_MODULE_EXPORT void set_color_map(GtkWidget *widg, gpointer data)
set color map callback
G_MODULE_EXPORT void on_create_new_project(GtkWidget *widg, gpointer data)
create a new project
void rotate_x_y(glwin *view, double angle_x, double angle_y)
rotate the OpenGL camera
G_MODULE_EXPORT void edit_in_new_project(GtkWidget *widg, gpointer data)
create new project using selection callback GTK3
G_MODULE_EXPORT void spin_stop(GtkButton *but, gpointer data)
stop spin
atomic_object * copied_object
void set_motion(glwin *view, int axis, int da, int db, gboolean UpDown, GdkModifierType state)
handle keyboard motion event on the OpenGL window
mat4_t insert_projection(glwin *view)
calculate the insertion projection matrix to insert object in the 3D window
G_MODULE_EXPORT void remove_the_atoms(GtkWidget *widg, gpointer data)
remove selected atom(s) callback GTK3
Function declarations to handle the atomic coordination data.
void set_advanced_bonding_menus(glwin *view)
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_back(glwin *view, int popm)
create the background color menu item GTK4
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
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
G_MODULE_EXPORT void cloned_poly(GtkWidget *widg, gpointer data)
cloned polyehdra callback - GTK3
GMenu * menu_poly(glwin *view, int popm)
create the 'Chemistry -> Polyehdra' submenu - GTK4
GMenu * menu_proj(glwin *view, int popm)
create the 'View -> Projection' 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_rep(glwin *view, int popm)
create 'View -> Representation' submenu items - 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...
void active_project_changed(int id)
change the active project
GtkWidget * prep_rings_menu(glwin *view, int id)