disallow passing a NULL image.
2007-03-20 Michael Natterer <mitch@gimp.org> * app/widgets/gimpcursorview.[ch] (gimp_color_frame_update_cursor): disallow passing a NULL image. (gimp_color_frame_clear_cursor): new function that clears the cursor view. * app/widgets/gimpcolorframe.c (gimp_color_frame_update): if color_frame->sample_valid is FALSE, don't do any color transformations and don't construct any string because none of them is going to be used (all labels will show "n/a"). * app/display/gimpstatusbar.[ch]: renamed set_cursor() API to update_cursor(). * app/display/gimpdisplayshell-cursor.c (gimp_display_shell_update_cursor): move variables to local scopes. Follow GimpStatusbar API change. Cleanup. (gimp_display_shell_clear_cursor): ditto. Follow GimpColorFrame API change. svn path=/trunk/; revision=22153
This commit is contained in:
committed by
Michael Natterer
parent
5ba99bdacd
commit
1c233b6fb6
@ -109,14 +109,10 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell,
|
||||
gint image_x,
|
||||
gint image_y)
|
||||
{
|
||||
GimpImage *image;
|
||||
gboolean new_cursor;
|
||||
gint t_x = -1;
|
||||
gint t_y = -1;
|
||||
|
||||
GimpDialogFactory *factory;
|
||||
GimpSessionInfo *session_info;
|
||||
GtkWidget *cursor_view = NULL;
|
||||
GimpImage *image;
|
||||
gboolean new_cursor;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
@ -148,24 +144,33 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell,
|
||||
/* use the passed image_coords for the statusbar because they are
|
||||
* possibly snapped...
|
||||
*/
|
||||
gimp_statusbar_set_cursor (GIMP_STATUSBAR (shell->statusbar),
|
||||
image_x, image_y);
|
||||
|
||||
/* ...but use the unsnapped display_coords for the info window */
|
||||
if (display_x >= 0 && display_y >= 0)
|
||||
gimp_display_shell_untransform_xy (shell, display_x, display_y,
|
||||
&t_x, &t_y, FALSE, FALSE);
|
||||
gimp_statusbar_update_cursor (GIMP_STATUSBAR (shell->statusbar),
|
||||
image_x, image_y);
|
||||
|
||||
factory = gimp_dialog_factory_from_name ("dock");
|
||||
session_info = gimp_dialog_factory_find_session_info (factory,
|
||||
"gimp-cursor-view");
|
||||
if (session_info && session_info->widget)
|
||||
cursor_view = gtk_bin_get_child (GTK_BIN (session_info->widget));
|
||||
{
|
||||
GtkWidget *cursor_view;
|
||||
|
||||
if (cursor_view)
|
||||
gimp_cursor_view_update_cursor (GIMP_CURSOR_VIEW (cursor_view),
|
||||
shell->display->image, shell->unit,
|
||||
t_x, t_y);
|
||||
cursor_view = gtk_bin_get_child (GTK_BIN (session_info->widget));
|
||||
|
||||
if (cursor_view)
|
||||
{
|
||||
gint t_x = -1;
|
||||
gint t_y = -1;
|
||||
|
||||
/* ...but use the unsnapped display_coords for the info window */
|
||||
if (display_x >= 0 && display_y >= 0)
|
||||
gimp_display_shell_untransform_xy (shell, display_x, display_y,
|
||||
&t_x, &t_y, FALSE, FALSE);
|
||||
|
||||
gimp_cursor_view_update_cursor (GIMP_CURSOR_VIEW (cursor_view),
|
||||
shell->display->image, shell->unit,
|
||||
t_x, t_y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -173,7 +178,6 @@ gimp_display_shell_clear_cursor (GimpDisplayShell *shell)
|
||||
{
|
||||
GimpDialogFactory *factory;
|
||||
GimpSessionInfo *session_info;
|
||||
GtkWidget *cursor_view = NULL;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
@ -183,11 +187,14 @@ gimp_display_shell_clear_cursor (GimpDisplayShell *shell)
|
||||
session_info = gimp_dialog_factory_find_session_info (factory,
|
||||
"gimp-cursor-view");
|
||||
if (session_info && session_info->widget)
|
||||
cursor_view = gtk_bin_get_child (GTK_BIN (session_info->widget));
|
||||
{
|
||||
GtkWidget *cursor_view;
|
||||
|
||||
if (cursor_view)
|
||||
gimp_cursor_view_update_cursor (GIMP_CURSOR_VIEW (cursor_view),
|
||||
NULL, GIMP_UNIT_PIXEL, 0, 0);
|
||||
cursor_view = gtk_bin_get_child (GTK_BIN (session_info->widget));
|
||||
|
||||
if (cursor_view)
|
||||
gimp_cursor_view_clear_cursor (GIMP_CURSOR_VIEW (cursor_view));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user