added "gboolean data_editable" which gets set in

2003-03-10  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdataeditor.[ch]: added "gboolean data_editable"
	which gets set in gimp_data_editor_real_set_data(). Set the name
	entry insensitive if the data is not editable.

	* app/widgets/gimpbrusheditor.c
	* app/widgets/gimppaletteeditor.c
	* app/widgets/gimpgradienteditor.c: look at editor->data_editable
	instead of duplicating the logic in all subclasses.

	* app/widgets/gimppreview.[ch]: added "gboolean expand" and
	gimp_preview_set_expand() like in GtkPreview bacause smooth auto
	resizing can only be done by the widget itself, not via external
	callbacks.

	* app/display/gimpnavigationview.c
	* app/widgets/gimpbrusheditor.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimpselectioneditor.c: set expand == TRUE. Removed
	"size_allocate" callbacks. They resize *much* smoother now.
	Various cleanups.

	* app/widgets/gimpnavigationpreview.c: recalculate the preview
	coordinates when the size changes.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimppreviewrenderer-utils.c
	* app/widgets/gimppreviewrenderergradient.[ch]: new renderer which
	is much faster because it projects the gradient without creating
	intermediate buffers. Rendering can be restricted to an interval
	from [left...right].

	* app/widgets/gimpgradienteditor.[ch]: undeprecated by using
	GimpPreview instead of GtkPreview. Cleanup.

	* app/gui/gradient-editor-commands.c: changed accordingly.
This commit is contained in:
Michael Natterer
2003-03-10 14:07:22 +00:00
committed by Michael Natterer
parent 3f588521ff
commit 1522b841fa
28 changed files with 1194 additions and 838 deletions

View File

@ -165,8 +165,6 @@ gradient_editor_load_left_cmd_callback (GtkWidget *widget,
}
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
}
void
@ -283,8 +281,6 @@ gradient_editor_load_right_cmd_callback (GtkWidget *widget,
}
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
}
void
@ -330,8 +326,6 @@ gradient_editor_blending_func_cmd_callback (GtkWidget *widget,
while (aseg != editor->control_sel_r);
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
}
void
@ -365,8 +359,6 @@ gradient_editor_coloring_type_cmd_callback (GtkWidget *widget,
while (aseg != editor->control_sel_r);
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
}
void
@ -493,9 +485,7 @@ gradient_editor_flip_cmd_callback (GtkWidget *widget,
/* Done */
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
gimp_gradient_editor_update (editor);
}
void
@ -601,9 +591,7 @@ gradient_editor_split_midpoint_cmd_callback (GtkWidget *widget,
editor->control_sel_r = rseg;
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
gimp_gradient_editor_update (editor);
}
void
@ -771,9 +759,7 @@ gradient_editor_delete_cmd_callback (GtkWidget *widget,
/* Done */
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
gimp_gradient_editor_update (editor);
}
void
@ -801,9 +787,7 @@ gradient_editor_recenter_cmd_callback (GtkWidget *widget,
while (aseg != editor->control_sel_r);
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
gimp_gradient_editor_update (editor);
}
void
@ -862,9 +846,7 @@ gradient_editor_redistribute_cmd_callback (GtkWidget *widget,
/* Done */
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
gimp_gradient_editor_update (editor);
}
void
@ -883,8 +865,6 @@ gradient_editor_blend_color_cmd_callback (GtkWidget *widget,
TRUE, FALSE);
gimp_data_dirty (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
}
void
@ -903,8 +883,6 @@ gradient_editor_blend_opacity_cmd_callback (GtkWidget *widget,
FALSE, TRUE);
gimp_data_dirty (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
}
@ -950,14 +928,12 @@ gradient_editor_left_color_changed (ColorNotebook *cnb,
case COLOR_NOTEBOOK_CANCEL:
gradient_editor_replace_selection (editor, editor->left_saved_segments);
GIMP_DATA (gradient)->dirty = editor->left_saved_dirty;
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gradient));
color_notebook_free (cnb);
editor->color_notebook = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
break;
}
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
}
static void
@ -1000,13 +976,12 @@ gradient_editor_right_color_changed (ColorNotebook *cnb,
case COLOR_NOTEBOOK_CANCEL:
gradient_editor_replace_selection (editor, editor->right_saved_segments);
GIMP_DATA (gradient)->dirty = editor->right_saved_dirty;
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gradient));
color_notebook_free (cnb);
editor->color_notebook = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
break;
}
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
}
static GimpGradientSegment *
@ -1126,9 +1101,7 @@ gradient_editor_split_uniform_callback (GtkWidget *widget,
editor->control_sel_r = rseg;
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
gimp_gradient_editor_update (editor);
}
static void
@ -1245,7 +1218,5 @@ gradient_editor_replicate_callback (GtkWidget *widget,
/* Done */
gimp_data_dirty (GIMP_DATA (gradient));
gimp_gradient_editor_update (editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
gimp_gradient_editor_update (editor);
}