73 gtk_window_set_title (GTK_WINDOW(view -> player -> win), str);
88 i = view -> anim -> last ->
img ->
step;
92 view -> anim -> last ->
img -> selected[k] -> selected = 0;
93 view -> anim -> last ->
img -> selected[k] -> first = NULL;
94 view -> anim -> last ->
img -> selected[k] -> last = NULL;
95 for (j=0; j<this_proj -> natomes; j++)
97 if (this_proj ->
atoms[o_step][j].
pick[k])
99 this_proj ->
atoms[i][j].pick[k] = FALSE;
104 this_proj ->
atoms[i][j].label[k] = TRUE;
127 else if (view -> anim -> last ->
img ->
step == 0)
156 view -> anim -> last ->
img ->
step = n_step;
179 if (view -> anim -> last ->
img ->
step > 0)
197 if (view -> anim -> last ->
img -> step < this_proj -> steps-1)
243 int s = (int)atof(m);
245 if (s > 0 && s <= this_proj -> steps)
260G_MODULE_EXPORT
void seq_jump (GtkButton * but, gpointer data)
263 GtkWidget * win =
dialogmodal (
"Enter a step number", GTK_WINDOW(view -> player -> win));
267 gchar * str = g_strdup_printf (
"Step number [%d-%d]: ", 1,
get_project_by_id(view ->
proj) -> steps);
283static gboolean animate (gpointer data)
292 else if (view -> loop)
298 view -> play = FALSE;
304 view -> play = FALSE;
318G_MODULE_EXPORT
void seq_play (GtkButton * but, gpointer data)
324 view -> stop = FALSE;
325 g_timeout_add (view -> speed, (GSourceFunc) animate, view);
337G_MODULE_EXPORT
void seq_stop (GtkButton * but, gpointer data)
340 view -> play = FALSE;
351G_MODULE_EXPORT
void seq_loop (GtkButton * but, gpointer data)
356 view -> loop = FALSE;
374static gboolean seq_wait_for_stop (gpointer data)
397G_MODULE_EXPORT
void seq_faster (GtkButton * but, gpointer data)
401 if (view -> play && view -> speed > 4)
403 oldspeed = view -> speed;
404 if (view -> speed == 5)
412 view -> play = FALSE;
413 g_timeout_add (oldspeed, (GSourceFunc) seq_wait_for_stop, view);
425G_MODULE_EXPORT
void seq_slower (GtkButton * but, gpointer data)
429 if (view -> play && view -> speed < 10000)
431 oldspeed = view -> speed;
432 if (view -> speed == 1)
440 view -> play = FALSE;
441 g_timeout_add (oldspeed, (GSourceFunc) seq_wait_for_stop, view);
457 if (view -> player == NULL)
460 view -> player = g_malloc0 (
sizeof*view -> player);
461 view -> player -> win =
create_win (
" ", view -> win, FALSE, FALSE);
470 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxa, view -> player -> first, TRUE, TRUE, 0);
473 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxa, view -> player -> prev, TRUE, TRUE, 0);
476 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxa, view -> player -> next, TRUE, TRUE, 0);
479 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxa, view -> player -> last, TRUE, TRUE, 0);
482 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxa, view -> player -> jump, TRUE, TRUE, 0);
489 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxb, view -> player -> play, TRUE, TRUE, 0);
492 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxb, view -> player -> stop, TRUE, TRUE, 0);
495 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxb, view -> player -> loop, TRUE, TRUE, 0);
498 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxb, view -> player -> fast, TRUE, TRUE, 0);
501 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hboxb, view -> player -> slow, TRUE, TRUE, 0);
508 gtk_widget_show (view -> player -> win);
Callback declarations for main window.
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
void process_selected_atom(project *this_proj, glwin *view, int id, int ac, int se, int pi)
process selected atom
Global variable declarations Global convenience function declarations Global data structure defin...
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
void recreate_all_shaders(glwin *view)
re-initialize all OpenGL shaders
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
void update_entry_int(GtkEntry *entry, int intval)
update the content of a GtkEntry as int
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
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
void button_set_image(GtkButton *but, gchar *text, int format, gpointer image)
Add an image to a GtkButton.
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
G_MODULE_EXPORT void run_destroy_dialog(GtkDialog *dialog, gint response_id, gpointer data)
to destroy a GtkDialog when the dialog emit the closing signal
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
gboolean in_md_shaders(project *this_proj, int id)
is this shader MD dependent ?
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
void show_the_widgets(GtkWidget *widg)
show GtkWidget
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...
void update_all_selections(glwin *view, int pi)
update the selection data: bonds, angles and dihedrals
void save_all_selections(glwin *view, int pi)
save all selection data
Function declarations for the creation of the OpenGL window.
Messaging function declarations.
G_MODULE_EXPORT void seq_jump(GtkButton *but, gpointer data)
jump to frame dialog
G_MODULE_EXPORT void seq_loop(GtkButton *but, gpointer data)
loop the animation
void update_selection(glwin *view, int o_step)
match and udpate selected atom()s from o_step to the active step
G_MODULE_EXPORT void seq_go_first(GtkButton *but, gpointer data)
go to first frame
G_MODULE_EXPORT void seq_go_to(GtkEntry *res, gpointer data)
jump to frame
G_MODULE_EXPORT void seq_go_previous(GtkButton *but, gpointer data)
go to previous frame
G_MODULE_EXPORT void seq_stop(GtkButton *but, gpointer data)
stop
G_MODULE_EXPORT void seq_go_next(GtkButton *but, gpointer data)
go to next frame
G_MODULE_EXPORT void seq_play(GtkButton *but, gpointer data)
play
void update_step_button(glwin *view)
correct widget buttons sensitivity based on MD step
void sequence(glwin *view, int o_step, int n_step)
sequence to next step
G_MODULE_EXPORT void seq_go_last(GtkButton *but, gpointer data)
got to last frame
G_MODULE_EXPORT void seq_slower(GtkButton *but, gpointer data)
go slower
void set_player_title(glwin *view)
set sequencer window title
G_MODULE_EXPORT void seq_faster(GtkButton *but, gpointer data)
go faster
G_MODULE_EXPORT void window_sequencer(GtkWidget *widg, gpointer data)
create the sequencer window