118 text[0] =
"X size must be > 0";
119 text[1] =
"Y size must be > 0";
134 this_proj -> curves[
b][
c] -> wsize[
d] = i;
170 cairo_surface_t * cst;
175 cst = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 100, 100);
176 tcst = cairo_create (cst);
177 cairo_set_source_rgb (tcst, bcol.
red, bcol.
green, bcol.
blue);
180 cairo_destroy (tcst);
193G_MODULE_EXPORT
void set_title (GtkCheckButton * but, gpointer data)
203G_MODULE_EXPORT
void set_title (GtkToggleButton * but, gpointer data)
247 g_free (this_proj -> curves[
b][
c] -> title);
248 this_proj -> curves[
b][
c] -> title = g_strdup_printf (
"%s - %s",
prepare_for_title(this_proj -> name), this_proj -> curves[
b][
c] -> name);
269 g_free (this_proj -> curves[
b][
c] -> title);
270 this_proj -> curves[
b][
c] -> title = g_strdup_printf (
"%s",
entry_get_text (tit));
290 g_free (this_proj -> curves[
b][
c] -> title_font);
291 this_proj -> curves[
b][
c] -> title_font = g_strdup_printf (
"%s", gtk_font_chooser_get_font (GTK_FONT_CHOOSER(fontb)));
335 if (v >= 0.0 && v <= 1.0)
337 this_proj -> curves[
b][
c] -> title_pos[
d] = v;
359 cairo_surface_t * surf;
366 this_proj -> curves[
b][
c] -> frame_dash,
367 this_proj -> curves[
b][
c] -> frame_thickness,
368 this_proj -> curves[
b][
c] -> frame_pos[0],
369 this_proj -> curves[
b][
c] -> frame_pos[1],
370 this_proj -> curves[
b][
c] -> frame_color,
371 this_proj -> curves[
b][
c] -> backcolor);
374 cairo_surface_destroy (surf);
393G_MODULE_EXPORT
void set_show_frame (GtkCheckButton * but, gpointer data)
540 this_proj -> curves[
b][
c] -> frame_pos[0][0] =
z;
544 show_warning (
"Frame x min must be < to frame x max", this_proj -> curves[
b][
c] -> window);
550 if (
z > this_proj -> curves[
b][
c] -> frame_pos[0][0])
552 this_proj -> curves[
b][
c] -> frame_pos[0][1] =
z;
556 show_warning (
"Frame x max must be > to frame x min", this_proj -> curves[
b][
c] -> window);
566 if (
z > this_proj -> curves[
b][
c] -> frame_pos[1][1])
568 this_proj -> curves[
b][
c] -> frame_pos[1][0] =
z;
572 show_warning (
"Frame y min must be > to frame y max", this_proj -> curves[
b][
c] -> window);
580 this_proj -> curves[
b][
c] -> frame_pos[1][1] =
z;
584 show_warning (
"Frame y max must be < to frame y min", this_proj -> curves[
b][
c] -> window);
601 GtkWidget * graphbox;
605 GtkWidget * frame_style_box;
606 GtkWidget * frame_thickness;
618 ftb[2] =
"right open";
619 ftb[3] =
"left open";
630 for ( i=0 ; i < 2 ; i++ )
651 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 5);
689 for ( i=0 ; i < 2 ; i++ )
698 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 10);
707 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 10);
727 gtk_widget_set_size_request (
fbox, 150, 30);
734 for ( i=1 ; i <
ndash ; i++)
738 gtk_widget_set_size_request (
fbox, 150, 30);
746 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
bbox (frame_style_box,
"Line width:"), frame_thickness, FALSE, FALSE, 0);
755 this_proj -> curves[
b][
c] -> frame_dash,
756 this_proj -> curves[
b][
c] -> frame_thickness,
757 this_proj -> curves[
b][
c] -> frame_pos[0],
758 this_proj -> curves[
b][
c] -> frame_pos[1],
759 this_proj -> curves[
b][
c] -> frame_color,
760 this_proj -> curves[
b][
c] -> backcolor);
762 cairo_surface_destroy (
frame);
785 xyf =
markup_label (g_strdup_printf (
"%s %s: ",axl[i], str[j]), 70, -1, 1.0, 0.5);
Callback declarations for main window.
Variable declarations for the curve layout edition window.
void update_curve(gpointer data)
update curve rendering
Variable declarations for the curve widget Functions for interactions with the curve widget.
void show_frame(cairo_t *cd, int tf, int da, int res[2], double ti, double x[2], double y[2], ColRGBA dcol)
draw frame
const gchar * default_title(int ax, int c)
default title string
int get_curve_shift(project *this_proj, int b, int c)
get cruve window size shift
void show_title(cairo_t *cr, project *this_proj, int rid, int cid)
draw title
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
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
void resize_this_window(GtkWidget *window, int x, int y)
resize this GtkWindow
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
int get_widget_height(GtkWidget *widg)
retrive GtkWidget height
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
int get_widget_width(GtkWidget *widg)
retrive GtkWidget width
GtkWidget * fbox(GtkWidget *box, char *lab)
box creating routine, to help design faster elements for the GUI
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 * 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 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_image_from_data(int format, gpointer item_image)
create Gtk image for data
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 * bbox(GtkWidget *box, char *lab)
box creating routine, to help design faster elements for the GUI
void add_box_child_end(GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the end position.
void update_entry_text(GtkEntry *entry, gchar *text)
update the content of a GtkEntry as string
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
int button_get_status(GtkWidget *button)
get status of check / toggle button
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
void show_warning(char *warning, GtkWidget *win)
show warning
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
G_MODULE_EXPORT void set_title(GtkToggleButton *but, gpointer data)
show / hide title toggle callback GTK3
GtkWidget * frame_style_area
cairo_surface_t * draw_frame_surface(int tf, int da, double ti, double x[2], double y[2], ColRGBA dcol, ColRGBA bcol)
draw frame preview
G_MODULE_EXPORT void set_title_color(GtkColorChooser *colob, gpointer data)
set title color
void set_data_style(gpointer data)
update the data style widgets
G_MODULE_EXPORT void set_title_font(GtkFontButton *fontb, gpointer data)
set title font
G_MODULE_EXPORT void set_frame_type(GtkComboBox *fbox, gpointer data)
change frame type
G_MODULE_EXPORT void set_title_custom(GtkEntry *tit, gpointer data)
set custom title entry callback
G_MODULE_EXPORT void set_title_pos(GtkEntry *entry, gpointer data)
set axis title position entry callback
GtkWidget * create_tab_1(gpointer data)
handle the creation of the 1st tab of the curve edition dialog
G_MODULE_EXPORT void set_frame_line(GtkComboBox *fbox, gpointer data)
change frame line type
GtkWidget * frame_pix_box
G_MODULE_EXPORT void set_frame_color(GtkColorChooser *colob, gpointer data)
set frame color
G_MODULE_EXPORT void set_background_color(GtkColorChooser *colob, gpointer data)
change background color
G_MODULE_EXPORT void set_title_default(GtkToggleButton *but, gpointer data)
use / not default title toggle callback GTK3
G_MODULE_EXPORT void set_frame_thickness(GtkEntry *entry, gpointer data)
set frame thickness entry callback
G_MODULE_EXPORT void set_frame_pos(GtkEntry *fen, gpointer data)
set frame position entry callback
G_MODULE_EXPORT void set_show_frame(GtkToggleButton *but, gpointer data)
show / hide frame toggle callback GTK3
void set_frame_style(gpointer data)
create frame preview
G_MODULE_EXPORT void set_window_size(GtkEntry *maj, gpointer data)
change window size entry callback