49void save_to_file_ (
int *,
char *,
int *,
double *,
double *,
int *,
int *,
int *,
double *,
int *,
int *,
int *,
int *,
int *,
char *);
50void prep_file_ (
int *,
char *,
int *,
int *,
int *,
int *,
double *,
int *,
int *);
51void append_to_file_ (
int *,
double *,
double *,
double *,
int *,
int *,
int *,
int *,
int *,
int *,
int *,
int *,
char *);
65G_MODULE_EXPORT
void run_write_curve (GtkNativeDialog * info, gint response_id, gpointer data)
67 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkFileChooserNative *)info);
78G_MODULE_EXPORT
void run_write_curve (GtkDialog * info, gint response_id, gpointer data)
80 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkWidget *)info);
82 int a, b, c, i, j, k, l, m, n, o, p, q;
88 if (response_id == GTK_RESPONSE_ACCEPT)
91 double delta = this_proj -> analysis[b] -> delta;
93 GtkFileFilter * tmp = gtk_file_chooser_get_filter (chooser);
102 k = strlen (this_curve -> cfile);
103 j = strlen (this_curve -> title);
105 if (this_curve -> extrac -> extras == 0)
110 & this_curve -> ndata,
111 this_curve -> data[0],
112 this_curve -> data[1],
113 & this_curve ->
scale[0],
114 & this_curve ->
scale[1],
115 & this_curve ->
layout -> aspect,
116 & delta, & b, & c, & this_proj -> nspec, & l,
117 & j, this_curve -> title);
122 p = this_curve -> extrac -> extras + 1;
124 prep_file_ (& k, this_curve -> cfile, & this_proj -> nspec, & l,
125 & this_curve ->
scale[0],
126 & this_curve ->
scale[1],
129 this_curve -> data[0],
130 this_curve -> data[1],
132 & this_curve ->
layout -> aspect,
133 & b, & c, & this_proj -> nspec, & l, & m, & p,
134 & j, this_curve -> title);
135 j = this_curve -> extrac -> extras;
136 CurveExtra * ctmp = this_curve -> extrac -> first;
137 for (i=0 ; i < j ; i++ )
144 j = strlen (this_proj -> analysis[o] -> curves[n] -> title);
146 this_proj -> analysis[o] -> curves[n] -> data[0],
147 this_proj -> analysis[o] -> curves[n] -> data[1],
148 & this_proj -> analysis[o] -> delta,
149 & ctmp ->
layout -> aspect,
150 & o, & n, & this_proj -> nspec, & l, & m, & p,
151 & j, this_proj -> analysis[o] -> curves[n] -> title);
152 if (ctmp -> next) ctmp = ctmp -> next;
173 GtkFileChooserNative * info;
179 GTK_WINDOW(this_curve -> window),
180 GTK_FILE_CHOOSER_ACTION_SAVE,
182 GtkFileChooser * chooser = GTK_FILE_CHOOSER(info);
184 gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);
186 filter1 = gtk_file_filter_new();
187 gtk_file_filter_set_name (GTK_FILE_FILTER(
filter1), _(
"Xmgrace file (*.agr)"));
188 gtk_file_filter_add_pattern (GTK_FILE_FILTER(
filter1),
"*.agr");
189 gtk_file_chooser_add_filter (chooser,
filter1);
190 filter2 = gtk_file_filter_new();
191 gtk_file_filter_set_name (GTK_FILE_FILTER(
filter2), _(
"x/y ASCII file (*.dat)"));
192 gtk_file_filter_add_pattern (GTK_FILE_FILTER(
filter2),
"*.dat");
193 gtk_file_chooser_add_filter (chooser,
filter2);
194 if (this_curve -> cfile != NULL)
201 gtk_file_chooser_set_current_name (chooser, this_curve -> name);
204 run_this_gtk_native_dialog ((GtkNativeDialog *)info, G_CALLBACK(
run_write_curve), idata);
double scale(double axe)
find appropriate major tick spacing based on axis length
Curve * get_curve_from_pointer(gpointer data)
get Curve pointer from pointer
Variable declarations for the curve widget Functions for interactions with the curve widget.
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 file_chooser_set_current_folder(GtkFileChooser *chooser)
set current folder in a GtkFilechooser
gchar * file_chooser_get_file_name(GtkFileChooser *chooser)
get a file name from a GtkFileChooser (single file selected)
gboolean file_chooser_set_file_name(GtkFileChooser *chooser, gchar *filename)
set file name in a GtkFilechooser
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
GtkWidget * create_file_chooser(const gchar *title, GtkWindow *parent, GtkFileChooserAction act, const gchar *act_name)
create a GtkFileChooser, utility to select file(s)
void destroy_this_native_dialog(GtkNativeDialog *dialog)
destroy a GtkNativeDialog
project * get_project_by_id(int p)
get project pointer using id number
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void active_project_changed(int id)
change the active project
void save_to_file_(int *, char *, int *, double *, double *, int *, int *, int *, double *, int *, int *, int *, int *, int *, char *)
void prep_file_(int *, char *, int *, int *, int *, int *, double *, int *, int *)
G_MODULE_EXPORT void run_write_curve(GtkDialog *info, gint response_id, gpointer data)
save curve data - running the dialog GTK3
void write_curve(gpointer idata)
save curve data - creating the dialog
void append_to_file_(int *, double *, double *, double *, int *, int *, int *, int *, int *, int *, int *, int *, char *)