61 int id = GPOINTER_TO_INT(data);
79 str = g_strdup_printf (
"_Axis length [ %f Å ]", v);
80 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_box_axis[1][7]), str);
92 str = g_strdup_printf (
"_Radius [ %f Å ]", v);
93 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_box_axis[1][6]), str);
102 str = g_strdup_printf (
"_Width [ %f pts ]", v);
103 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_box_axis[1][4]), str);
116 str = g_strdup_printf (
"_Radius [ %f Å ]", v);
117 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_box_axis[0][6]), str);
127 str = g_strdup_printf (
"_Width [ %f pts ]", v);
128 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_box_axis[0][4]), str);
142 str = g_strdup_printf (
"Cylinder(s) [ %f Å ]", v);
143 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_bonds[8]), str);
156 str = g_strdup_printf (
"Cylinder(s) [ %f Å ]", v);
157 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_bonds[1]), str);
190 for (k=0; k<s-1; k++)
192 for (l=k+1; l<s; l++)
204 g_debug (
"UPDATE_BONDS:: id= %d, a= %d, b=%d, a+2s= %d, b+2s= %d, val= %f",
id,
a,
b,
a+2*s,
b+2*s, v);
216 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_bonds[5+8*
c]),
230 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_bonds[3+8*
c]),
254 int i, j, k, l, m, n;
255 gchar * dim[2]={
" pts",
" Å "};
260 if (this_proj -> modelgl -> anim -> last ->
img -> style ==
WIREFRAME)
268 for (i=0, k=aoc*nspec; i<nspec; i++, k++)
270 j = i + aoc * nspec * (nspec + 1) / 2;
272 gtk_widget_set_size_request (hbo, 250, -1);
283 for (i=0; i<nspec-1; i++)
285 for (j=i+1; j<nspec; j++, k++)
290 gtk_widget_set_size_request (hbo, 250, -1);
328 gchar * title[2][2] = {{
"Adjust atomic bond radius(ii)",
"Adjust clone bond radius(ii)"},
329 {
"Adjust atomic line width(s)",
"Adjust clone line width(s)"}};
331 int p = the_data ->
a;
335 int id = the_data ->
b;
336 int jd = the_data ->
c;
363G_MODULE_EXPORT
void window_bonds (GSimpleAction *
action, GVariant * parameter, gpointer data)
378 gchar * obj[4] = {
"box",
"axis",
"bond",
"clone bond"};
379 gchar * Nobj[4] = {
"Box",
"Axis",
"Bond",
"Clone bond"};
385 str = g_strdup_printf (
"Adjust axis length");
389 str = g_strdup_printf (
"Adjust %s line width", obj[bid ->
c]);
393 str = g_strdup_printf (
"Adjust %s cylinders radius", obj[bid ->
c]);
397 str = g_strdup_printf (
"Adjust %s cylinders radius", obj[bid ->
b]);
405 gtk_widget_set_size_request (
hbox, 300, -1);
410 str = g_strdup_printf (
"Axis length");
413 str = g_strdup_printf (
"%s line width", Nobj[bid ->
c]);
416 str = g_strdup_printf (
"%s cylinders radius", Nobj[bid ->
c]);
419 str = g_strdup_printf (
"%s cylinders radius", Nobj[bid ->
b]);
422 GtkWidget *
label = gtk_label_new (str);
424 gtk_widget_set_size_request (
label, 150, -1);
452 gtk_widget_set_size_request (win, 350, 100);
integer(kind=c_int) function chemistry()
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
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
double string_to_double(gpointer string)
convert string to double
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
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 * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
void opengl_project_changed(int id)
change the OpenGL project
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.
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
void show_the_widgets(GtkWidget *widg)
show GtkWidget
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_bond_parameter(GtkWidget *widg, gpointer data)
update bond parameter callback - creating the dialog GTK3
void bonds_input_win(GtkWidget *win, project *this_proj, int nspec, int aoc, double **val)
prepare bond property entry list
G_MODULE_EXPORT void update_bond_parameter(GtkEntry *res, gpointer data)
update bond parameter callback
gchar * label_cutrab(project *this_proj, glwin *view, int id)
prepare the text of a menu item in the 'Model -> Bond(s)' submenu
G_MODULE_EXPORT void window_bonds(GtkWidget *widg, gpointer data)
create bond(s) configuration window(s) callback GTK3