Bug 496772 – Position shown in the statusbar needs more precision (for

2008-08-20  Michael Natterer  <mitch@gimp.org>

	Bug 496772 – Position shown in the statusbar needs more
	precision (for some tools)

	* app/display/display-enums.[ch]: add enum GimpCursorPrecision
	which can be one of { PIXEL_CENTER, PIXEL_BORDER, SUBPIXEL }.

	* app/display/gimpdisplayshell-cursor.[ch]: add "precision"
	parameter to gimp_display_shell_update_cursor() and pass it
	on to the statusbar.

	* app/display/gimpstatusbar.[ch]: add "precision" parameters to
	the cursor coordinates APIs, offset the passed coords accordingly
	and display them with one decimal point if SUBPIXEL is requested
	and the display's unit is PIXEL. Keep a second floating-point
	format string around at any time.

	* app/tools/gimptoolcontrol.[ch]: add a "precision" member and API
	so tools can configure the precision they need. Defalt to
	PIXEL_CENTER since that's right for almost all tools.

	* app/display/gimpdisplayshell-callbacks.c: pass the tool's
	precision to gimp_display_shell_update_cursor().

	* app/tools/gimptool.[ch]: add "precision" parameter to
	gimp_tool_push_status_coords() and pass it on to the statusbar.

	* app/tools/gimpaligntool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpcolortool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c: set precision in init() where
	needed. Adjust the precision in the fly when needed, e.g. while
	moving guides or when toggling hard-edge on paint tools. Also pass
	an appropriate precision to gimp_tool_push_status_coords(), which
	is not always the tool's precision as used for cursor display.


svn path=/trunk/; revision=26681
This commit is contained in:
Michael Natterer
2008-08-20 16:22:09 +00:00
committed by Michael Natterer
parent 05287d057a
commit d51c50820f
26 changed files with 370 additions and 112 deletions

View File

@ -52,6 +52,7 @@ struct _GimpStatusbar
GimpMessageSeverity temp_severity;
gchar cursor_format_str[CURSOR_FORMAT_LENGTH];
gchar cursor_format_str_f[CURSOR_FORMAT_LENGTH];
gchar length_format_str[CURSOR_FORMAT_LENGTH];
GtkWidget *cursor_label;
@ -93,6 +94,7 @@ void gimp_statusbar_push_valist (GimpStatusbar *statusbar,
void gimp_statusbar_push_coords (GimpStatusbar *statusbar,
const gchar *context,
const gchar *stock_id,
GimpCursorPrecision precision,
const gchar *title,
gdouble x,
const gchar *separator,
@ -133,6 +135,7 @@ void gimp_statusbar_push_temp_valist (GimpStatusbar *statusbar,
void gimp_statusbar_pop_temp (GimpStatusbar *statusbar);
void gimp_statusbar_update_cursor (GimpStatusbar *statusbar,
GimpCursorPrecision precision,
gdouble x,
gdouble y);
void gimp_statusbar_clear_cursor (GimpStatusbar *statusbar);