コード例 #1
0
void mirror_vertical_callb(GtkWidget *wdg, gpointer data) {

	hf_wrapper_struct *hfw;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
	if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wdg))) {
		hf_commit_or_reset (hfw->hf_options);
		return;
	}
	if (!hfw->hf_options->img->mirror_vertical_dialog) {
		hfw->hf_options->img->mirror_vertical_dialog = mirror_vertical_dialog_new(data);
		gtk_container_add(GTK_CONTAINER(hfw->hf_options->img->img_dialog),
			hfw->hf_options->img->mirror_vertical_dialog );
	}
	if (hfw->hf_options->img->current_subdialog)
		gtk_widget_hide(hfw->hf_options->img->current_subdialog);
	hfw->hf_options->img->current_subdialog = hfw->hf_options->img->mirror_vertical_dialog;
	gtk_widget_show(hfw->hf_options->img->current_subdialog);
	hf_backup(hfw->hf_struct);	// We need to copy the result in the tmp_buf if we want to allow
					// the user to revert the operation by clicking repeatedly on the mirror button
	hf_vertical_mirror(hfw->hf_struct);
	begin_pending_record(hfw,"Vertical mirror",accept_fn,reset_fn);
	(*hfw->if_modified) = TRUE;
	hfw->if_calculated = TRUE;
	draw_hf(hfw);
}
コード例 #2
0
ファイル: voronoi_dialog.c プロジェクト: didier13150/geomorph
void edges_level_callb (GtkWidget *wdg, gpointer data) {
	hf_wrapper_struct *hfw;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
	
	voronoi_adjust_edges (hfw->hf_struct->result_buf, hfw->hf_struct->hf_buf, hfw->hf_struct->tmp2_buf, hfw->hf_options->img->voronoi->edges_level,  hfw->hf_struct->max_x, hfw->hf_struct->max_y);

	draw_hf(hfw);
}
コード例 #3
0
void apply_rotate_callb (GtkWidget *wdg, gpointer data) {
	hf_wrapper_struct *hfw;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
	if (hfw->if_calculated)
		return;
	apply_rotate(hfw);
//	printf("Apply_rotate in apply_rotate_callb\n");
	draw_hf(hfw);
}
コード例 #4
0
ファイル: wind_dialog.c プロジェクト: consultit/geomorph
void repeat_wind_callb (GtkWidget *wdg, gpointer data) {
	wind_dialog_struct *wds;	
	hf_wrapper_struct *hfw;
	wds = (wind_dialog_struct *) data;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) wds->parent_data;
	hf_backup(hfw->hf_struct);
	hfw->if_calculated = FALSE;
	apply_wind(wds);
	draw_hf(hfw);
}
コード例 #5
0
ファイル: wind_dialog.c プロジェクト: consultit/geomorph
void apply_wind_callb (GtkWidget *wdg, gpointer data) {
	wind_dialog_struct *wds;
	hf_wrapper_struct *hfw;
	wds = (wind_dialog_struct *) data;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) wds->parent_data;
//	We reapply the process on the source
//	(it works on hf-hf_buf, without copying tmp_buf to hf_buf);
	hf_restore(hfw->hf_struct);
	apply_wind(wds);
	draw_hf(hfw);
}
コード例 #6
0
void calc_slider (hf_wrapper_struct *hfw) {
	if (hfw->if_calculated)
		return;
	hf_slide(hfw->hf_struct,
		hfw->hf_options->img->slideh,
		hfw->hf_options->img->slidev);
	begin_pending_record(hfw,"Translate",accept_fn,reset_fn);
	gtk_widget_set_sensitive(GTK_WIDGET(hfw->hf_options->img->slide_accept),TRUE);
	(*hfw->if_modified) = TRUE;
	hfw->if_calculated = TRUE;
	draw_hf(hfw);
}
コード例 #7
0
ファイル: voronoi_dialog.c プロジェクト: didier13150/geomorph
void apply_voronoi_callb (GtkWidget *wdg, gpointer data) {
	hf_wrapper_struct *hfw;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
	if (hfw->if_calculated)
		return;
	apply_voronoi(hfw);
	(*hfw->if_modified) = TRUE;
	hfw->if_calculated = TRUE;
	begin_pending_record(hfw,"Cracks network",accept_fn,reset_fn);
	gtk_widget_set_sensitive(GTK_WIDGET(hfw->hf_options->img->voronoi_dialog->accept),TRUE);
	draw_hf(hfw);
	hfw->if_calculated =  FALSE;
}
コード例 #8
0
void rotate_angle_upd (GtkWidget *wdg, gpointer data) {
	hf_wrapper_struct *hfw;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
	if (hfw->hf_options->img->angle == (gint) GTK_ADJUSTMENT(wdg)->value)
		return;
	hfw->hf_options->img->angle = (gint) GTK_ADJUSTMENT(wdg)->value;
	hfw->if_calculated = FALSE;
	if (!hfw->hf_struct->tmp_buf)
		hf_backup(hfw->hf_struct);
//	Replace with hf_fast_rotate, if too slow
//	NB:  hf_fast_rotate creates inconsistencies in the commitment sequence
//	... sometimes part of the process is not applied when the change is committed ??
	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hfw->hf_options->img->auto_rotate))) {
		apply_rotate(hfw);
		draw_hf(hfw);
	}
}
コード例 #9
0
void calc_stretch(hf_wrapper_struct *hfw) {
	begin_pending_record(hfw,"Stretch",accept_fn,reset_fn);
	gtk_widget_set_sensitive(GTK_WIDGET(hfw->hf_options->img->stretch_accept),TRUE);
	(*hfw->if_modified) = TRUE;
	draw_hf(hfw);
}