63#define AXIS_TEMPLATES 5
65gchar *
axis[3] = {
"X",
"Y",
"Z"};
67gchar *
al[3] = {
"% of the window width",
"% of the window height",
"% of the window depth"};
68gchar *
axis_template[
AXIS_TEMPLATES] = {
"Top Right Corner *",
"Top Left Corner *",
"Bottom Right Corner *",
"Bottom Left Corner *",
"Center **"};
71double axis_range[3][2] = {{0.0,100.0}, {0.0, 100.0}, {0.0, 100.0}};
74extern G_MODULE_EXPORT
void set_labels_font (GtkFontButton * fontb, gpointer data);
76extern G_MODULE_EXPORT
void set_labels_scale (GtkCheckButton * but, gpointer data);
78extern G_MODULE_EXPORT
void set_labels_scale (GtkToggleButton * but, gpointer data);
104 i = view -> anim -> last ->
img -> axispos;
110 gtk_combo_box_set_active (GTK_COMBO_BOX(
templates), i);
125 int i = gtk_combo_box_get_active (box);
127 view -> anim -> last ->
img -> axispos = i;
128 view -> create_shaders[
MAXIS] = TRUE;
132 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[1][8+i], TRUE);
147 switch (gtk_combo_box_get_active (box))
155 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[1][1], TRUE);
164 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[1][2], TRUE);
169 view -> create_shaders[
MAXIS] = TRUE;
199 val = gtk_check_button_get_active (but);
201 val = gtk_toggle_button_get_active (but);
210 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[1][0], TRUE);
218 view -> anim -> last ->
img -> box_axis[1] =
NONE;
221 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[1][0], FALSE);
227 view -> create_shaders[
MAXIS] = TRUE;
257 val = gtk_check_button_get_active (but);
259 val = gtk_toggle_button_get_active (but);
265 view -> anim -> last ->
img -> axispos = 2;
268 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[1][10], TRUE);
273 view -> anim -> last ->
img -> axispos =
CUSTOM;
279 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_box_axis[1][i], FALSE);
284 view -> create_shaders[
MAXIS] = TRUE;
299 for (i = 0; i < 3; i++)
304 view -> anim -> last ->
img -> axis_color[i].alpha = 1.0;
335 val = gtk_check_button_get_active (but);
337 val = gtk_toggle_button_get_active (but);
342 if (view -> anim -> last ->
img -> axis_color != NULL)
345 g_free (view -> anim -> last ->
img -> axis_color);
347 view -> anim -> last ->
img -> axis_color = NULL;
351 view -> anim -> last ->
img -> axis_color = g_malloc (3*
sizeof*view -> anim -> last ->
img -> axis_color);
355 view -> create_shaders[
MAXIS] = TRUE;
372 view -> create_shaders[
MAXIS] = TRUE;
388 if (v >= 0.0 && v <= 100.0) view -> anim -> last ->
img -> axis_pos[dat ->
b] = v;
389 view -> create_shaders[
MAXIS] = TRUE;
431G_MODULE_EXPORT
void set_axis_labels (GtkCheckButton * but, gpointer data)
448 val = gtk_check_button_get_active (but);
450 val = gtk_toggle_button_get_active (but);
452 view -> anim -> last ->
img -> axis_labels =
val;
454 view -> create_shaders[
MAXIS] = TRUE;
472 view -> anim -> last ->
img ->
axis_title[dat ->
b] = g_strdup_printf (
"%s", m);
473 view -> create_shaders[
MAXIS] = TRUE;
487G_MODULE_EXPORT
void axis_advanced (GSimpleAction *
action, GVariant * parameter, gpointer data)
502 GtkWidget * win =
dialogmodal (
"Advanced axis settings", GTK_WINDOW(view -> win));
507 if (view -> anim -> last ->
img -> box_axis[
AXIS] !=
NONE)
515 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox,
check_button (
"Show / hide axis", 100, 40, ac, G_CALLBACK(
set_show_axis_toggle), data), FALSE, FALSE, 0);
524 if (view -> anim -> last ->
img -> axispos !=
CUSTOM)
541 gtk_widget_set_size_request (
templates, 150, -1);
553 markup_label(
"Please choose axis position:", -1, -1, 0.0, 0.5), FALSE, TRUE, 5);
559 ax_name = gtk_label_new (
axis[i]);
560 gtk_widget_set_size_request (ax_name, 20, -1);
564 view -> anim -> last ->
img -> axis_pos[i],
569 ax_name = gtk_label_new (
al[i]);
589 gtk_combo_box_set_active (GTK_COMBO_BOX(
styles), i);
590 gtk_widget_set_size_request (
styles, 150, -1);
609 view -> anim -> last ->
img -> axis_labels,
614 box =
abox (axis_label_box,
"Rendering: ", 0);
618 gtk_combo_box_set_active (GTK_COMBO_BOX(config), view -> anim -> last ->
img -> labels_render[2]);
619 gtk_widget_set_size_request (config, 150, -1);
622 box =
abox (axis_label_box,
"Font:", 0);
627 box =
abox (axis_label_box,
"Size:", 0);
637 if ( view -> anim -> last ->
img -> axis_color == NULL)
655 if ( view -> anim -> last ->
img -> axis_color != NULL)
689 update_menu_bar (view);
GMainLoop * Event_loop[5]
Global variable declarations Global convenience function declarations Global data structure defin...
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
GtkWidget * font_button(gchar *font, int dimx, int dimy, GCallback handler, gpointer data)
create a font selection button
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
gboolean is_the_widget_visible(GtkWidget *widg)
test if a GtkWidget exist, then return if it is visible or not
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
GdkRGBA colrgba_togtkrgba(ColRGBA col)
convert ColRGBA color to GdkRGBA color
void opengl_project_changed(int id)
change the OpenGL project
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
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 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
void gtk_label_align(GtkWidget *lab, float ax, float ay)
set text alignment in a GtkLabel
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
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
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
void update_entry_text(GtkEntry *entry, gchar *text)
update the content of a GtkEntry as string
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...
Function declarations for the creation of the OpenGL window.
Messaging function declarations.
G_MODULE_EXPORT void set_labels_font(GtkFontButton *fontb, gpointer data)
change label(s) font
gchar * axis_template[AXIS_TEMPLATES]
G_MODULE_EXPORT void set_axis_title(GtkEntry *entry, gpointer data)
set axis title callback
G_MODULE_EXPORT void update_bond_parameter(GtkEntry *res, gpointer data)
update bond parameter callback
G_MODULE_EXPORT gboolean scroll_set_axis_position(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
change axis position - scroll callback
gchar * axis_style[AXIS_STYLES]
G_MODULE_EXPORT void use_axis_default_positions(GtkToggleButton *but, gpointer data)
use axis default colors callback GTK3
G_MODULE_EXPORT void set_labels_render(GtkWidget *widg, gpointer data)
void axis_position_has_changed(gpointer data, double v)
change axis position
GtkWidget * axis_color_title[3]
G_MODULE_EXPORT void set_axis_combo_style(GtkComboBox *box, gpointer data)
set axis style callback
void init_axis_colors(glwin *view)
initialize axis colors
G_MODULE_EXPORT void set_show_axis_toggle(GtkToggleButton *but, gpointer data)
show / hide axis callback GTK3
G_MODULE_EXPORT void axis_advanced(GtkWidget *widg, gpointer data)
create the axis advanced parameters window callback GTK3
GtkWidget * axis_position_box
G_MODULE_EXPORT void set_axis_color(GtkColorChooser *colob, gpointer data)
change axis color
G_MODULE_EXPORT void set_axis_template(GtkComboBox *box, gpointer data)
set axis position callback
G_MODULE_EXPORT void set_labels_scale(GtkToggleButton *but, gpointer data)
change label(s) scale - toggle callback GTK3
G_MODULE_EXPORT void use_axis_default_colors(GtkToggleButton *but, gpointer data)
use axis default color callback GTK3
void activate_pos_box(glwin *view, gboolean val)
update axis position data
G_MODULE_EXPORT void set_axis_labels(GtkToggleButton *but, gpointer data)
set axis labels callback GTK3
G_MODULE_EXPORT void set_axis_position(GtkRange *range, gpointer data)
change axis position - range callback
double axis_init_color[3][3]