89 gtk_color_chooser_set_rgba ((GtkColorChooser *)gradient_win -> col_but, &
col);
93 gtk_color_chooser_set_rgba ((GtkColorChooser *)gradient_win -> grad_but[i], &
col);
103 combo_set_active (gradient_win -> d_box[back -> gradient - 1], back -> direction);
129 if (response_id == GTK_RESPONSE_OK)
134 this_proj -> modelgl -> anim -> last ->
img -> back ->
color = colo;
135 this_proj -> modelgl -> anim -> last ->
img -> back -> gradient = 0;
137 this_proj -> modelgl -> create_shaders[
MEASU] = TRUE;
138 if (this_proj -> modelgl -> gradient_win)
145 this_proj -> modelgl -> anim -> last ->
img -> abc ->
color = colo;
146 this_proj -> modelgl -> create_shaders[
MDBOX] = TRUE;
150 this_proj -> modelgl -> anim -> last ->
img -> at_color[
wc_cid] = colo;
153 int shader[1] = {
POLYS};
154 if (this_proj -> modelgl -> anim -> last ->
img -> color_map[1] == 0)
re_create_md_shaders (1, shader, this_proj);
156 update (this_proj -> modelgl);
175 str = g_strdup_printf (
"Background color");
180 str = g_strdup_printf (
"Model box color");
191 str = g_strdup_printf (
"%s* - clone(s) color", this_proj ->
chemistry ->
label[
wc_cid-this_proj -> nspec]);
195 GtkWidget * win = gtk_color_chooser_dialog_new (str, GTK_WINDOW(view -> win));
196 gtk_window_set_modal (GTK_WINDOW(win), TRUE);
197 gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER(win), TRUE);
198 gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER(win), &
col);
273 view -> create_shaders[
BACKG] = TRUE;
275 view -> create_shaders[
MEASU] = TRUE;
313 the_gradient = view -> gradient_win;
314 the_back = view -> anim -> last ->
img -> back;
318 view -> anim -> last ->
img -> back -> gradient = i;
319 view -> anim -> last ->
img -> back -> direction = 0;
322 view -> anim -> last ->
img -> back -> direction = i;
330 if (! bid ->
b && ! i)
336 view -> create_shaders[
BACKG] = TRUE;
338 view -> create_shaders[
MEASU] = TRUE;
361 if (v >= 0.0 && v <= 1.0) view -> anim -> last ->
img -> back ->
position = v;
362 view -> create_shaders[
BACKG] = TRUE;
421 g_free (view -> gradient_win);
422 view -> gradient_win = NULL;
437 GtkWidget * hhbox, * vvbox;
457 view = (
glwin *)data;
458 view -> gradient_win = g_malloc0(
sizeof*view -> gradient_win);
459 the_gradient = view -> gradient_win;
460 back_gradient = view -> anim -> last ->
img -> back -> gradient;
461 back_direction = view -> anim -> last ->
img -> back -> direction;
462 back_position = view -> anim -> last ->
img -> back ->
position;
463 back_color = view -> anim -> last ->
img -> back ->
color;
464 gradient_color = view -> anim -> last ->
img -> back -> gradient_color;
469 adv_box (the_gradient -> win,
"<b>Background settings</b>", 5, 120, 0.0);
477 the_gradient -> win =
create_win (str, view -> win, FALSE, FALSE);
482 gchar * g_name[2] = {
"Gradient type",
"Gradient direction"};
483 gchar * g_type[3] = {
"No gradient",
"Linear",
"Circular"};
484 gchar * g_direction[2][9] = {{
"Top to bottom",
"Right to left",
"Bottom right to top left",
"Top right to bottom left",
"",
"",
"",
"",
""},
485 {
"Right to left",
"Left to right",
"Top to bottom",
"Bottom to top",
486 "Bottom right to top left",
"Bottom left to top right",
"Top right to bottom left",
"Top left to bottom right",
"Center"}};
487 int n_val[2] = {4, 9};
495 gtk_widget_set_size_request (the_gradient -> g_box, 200, -1);
502 hbox =
abox (the_gradient -> dir, g_name[1], 5);
506 for (j=0; j<n_val[i]; j++)
510 gtk_widget_set_size_request (the_gradient -> d_box[i], 200, -1);
532 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, the_gradient -> col_but, FALSE, FALSE, 0);
541 gchar * c_name[2] = {
"First color",
"Second color"};
549 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, the_gradient -> grad_but[i], FALSE, FALSE, 0);
591 view -> create_shaders[
MDBOX] = TRUE;
625 this_proj -> modelgl -> create_shaders[
LABEL] = TRUE;
626 update (this_proj -> modelgl);
646 if (response_id == GTK_RESPONSE_OK)
649 this_proj -> modelgl -> anim -> last ->
img -> spcolor[g][s][
c] =
get_window_color (GTK_WIDGET(win));
652 update (this_proj -> modelgl);
690 str = g_strdup_printf (
"%s atom(s) %d fold coordination sphere color", this_proj ->
chemistry ->
label[s],
691 this_proj -> coord -> geolist[0][s][
c]);
694 str = g_strdup_printf (
"%s - %s coordination sphere color", this_proj ->
chemistry ->
label[s],
698 str = g_strdup_printf (
"Fragment N°%d color",
c);
703 str = g_strdup_printf (
"Molecule N°%d color",
c);
708 str = g_strdup_printf (
"%d atom chain(s) color", this_proj -> coord -> geolist[g][0][
c]);
712 str = g_strdup_printf (
"%s - %d atom ring(s) color",
rings_type[s], this_proj -> coord -> geolist[g][0][
c]);
716 GtkWidget * win = gtk_color_chooser_dialog_new (str, GTK_WINDOW(this_proj -> modelgl -> win));
719 gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER(win), TRUE);
720 gtk_window_set_modal ((GtkWindow *)win, TRUE);
integer(kind=c_int) function chemistry()
GtkWidget * color_box(glwin *view, int ideo, int spec, int geo)
create the color palette pointers and menus GTK3 version
Structure definitions for color management Function declarations for color management.
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
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
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
void set_color_chooser_color(GtkWidget *color_win, ColRGBA col)
set the color of a color selection window
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
ColRGBA get_window_color(GtkWidget *color_win)
get the ColRGBA color from a color selection window
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
GdkRGBA colrgba_togtkrgba(ColRGBA col)
convert ColRGBA color to GdkRGBA color
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
void add_global_option(GtkWidget *vbox, tint *oid)
add a button to update global user preferences
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
create a GtkLabel with pango markup
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.
ColRGBA get_button_color(GtkColorChooser *colob)
get the ColRGBA color from a GtkColorChooser button
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
GtkWidget * color_button(ColRGBA col, gboolean alpha, int dimx, int dimy, GCallback handler, gpointer data)
create a color selection button
GtkWidget * create_hscale(float min, float max, float delta, float val, int pos, int round, int size, GCallback handler, GCallback scroll_handler, gpointer data)
create an horizontal scale GtkWidget
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
GtkWidget * abox(GtkWidget *box, char *lab, int vspace)
box creating routine, to help design faster elements for the GUI
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 re_create_md_shaders(int nshaders, int shaders[nshaders], project *this_proj)
re-initialize some MD dependent OpenGL shaders
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
shaders
The different types of shaders in the atomes program.
Function declarations for the creation of the OpenGL window.
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.
gradient_edition * pref_gradient_win
GtkWidget * adv_box(GtkWidget *box, char *lab, int vspace, int size, float xalign)
create a box with markup label
background * tmp_background
Preference variable declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
G_MODULE_EXPORT void to_run_back_color_window(GtkWidget *widg, gpointer data)
to run background color selection window callback GTK3
G_MODULE_EXPORT void set_gradient_color(GtkColorChooser *colob, gpointer data)
change background color
G_MODULE_EXPORT void to_run_box_color_window(GtkWidget *widg, gpointer data)
to run box color selection window callback GTK3
void back_position_has_changed(gpointer data, GLfloat v)
change gradient mixed position
G_MODULE_EXPORT void set_back_position(GtkRange *range, gpointer data)
set gradient mixed position - range callback
G_MODULE_EXPORT gboolean on_gradient_delete(GtkWidget *widg, GdkEvent *event, gpointer data)
gradient window delete event - GTK3
G_MODULE_EXPORT void gradient_advanced(GtkWidget *widg, gpointer data)
Background configuration window.
G_MODULE_EXPORT void set_gradient_parameter(GtkWidget *widg, gpointer data)
set gradient parameter callback
G_MODULE_EXPORT gboolean scroll_set_back_position(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
set gradient mixed position - scroll callback
G_MODULE_EXPORT void window_color_coord(GtkWidget *widg, gpointer data)
create a window to select a color callback GTK3
void update_gradient_widgets(gradient_edition *gradient_win, background *back)
update the widgets of the gradient window
G_MODULE_EXPORT void run_window_color(GtkDialog *win, gint response_id, gpointer data)
window color chooser - running the dialog
void window_color(project *this_proj, glwin *view)
window color chooser - creating the dialog
G_MODULE_EXPORT void run_window_color_coord(GtkDialog *win, gint response_id, gpointer data)
window to select a color - running the dialog
G_MODULE_EXPORT void to_run_atom_color_window(GtkWidget *widg, gpointer data)
to run atom color selection window callback GTK3