add gimp_display_empty()/fill() which turns it into an empty display and
2008-03-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay.[ch]: add gimp_display_empty()/fill() which turns it into an empty display and back. * app/display/gimpdisplayshell.[ch]: add same api here. * app/display/gimpdisplayshell-close.c * app/gui/gui-vtable.c: use the new functions instead of having the code here. * app/display/gimpdisplayshell-selection.c (gimp_display_shell_selection_control): stop the timeout and free the segments when this function is called on an empty display. svn path=/trunk/; revision=25124
This commit is contained in:

committed by
Michael Natterer

parent
3899de098f
commit
a098b12f55
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
||||
2008-03-19 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/display/gimpdisplay.[ch]: add gimp_display_empty()/fill()
|
||||
which turns it into an empty display and back.
|
||||
|
||||
* app/display/gimpdisplayshell.[ch]: add same api here.
|
||||
|
||||
* app/display/gimpdisplayshell-close.c
|
||||
* app/gui/gui-vtable.c: use the new functions instead of having
|
||||
the code here.
|
||||
|
||||
* app/display/gimpdisplayshell-selection.c
|
||||
(gimp_display_shell_selection_control): stop the timeout and free
|
||||
the segments when this function is called on an empty display.
|
||||
|
||||
2008-03-19 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/uri/uri-backend-gio.c (copy_uri): fixed stupid bug.
|
||||
|
@ -494,6 +494,32 @@ gimp_display_set_image (GimpDisplay *display,
|
||||
gimp_display_shell_update_icon (GIMP_DISPLAY_SHELL (display->shell));
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_empty (GimpDisplay *display)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
||||
g_return_if_fail (GIMP_IS_IMAGE (display->image));
|
||||
|
||||
gimp_display_set_image (display, NULL);
|
||||
|
||||
gimp_display_shell_empty (GIMP_DISPLAY_SHELL (display->shell));
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_fill (GimpDisplay *display,
|
||||
GimpImage *image,
|
||||
GimpUnit unit,
|
||||
gdouble scale)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||
|
||||
gimp_display_set_image (display, image);
|
||||
|
||||
gimp_display_shell_fill (GIMP_DISPLAY_SHELL (display->shell),
|
||||
image, unit, scale);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_update_area (GimpDisplay *display,
|
||||
gboolean now,
|
||||
|
@ -74,6 +74,12 @@ GimpDisplay * gimp_display_get_by_ID (Gimp *gimp,
|
||||
void gimp_display_set_image (GimpDisplay *display,
|
||||
GimpImage *image);
|
||||
|
||||
void gimp_display_empty (GimpDisplay *display);
|
||||
void gimp_display_fill (GimpDisplay *display,
|
||||
GimpImage *image,
|
||||
GimpUnit unit,
|
||||
gdouble scale);
|
||||
|
||||
void gimp_display_update_area (GimpDisplay *display,
|
||||
gboolean now,
|
||||
gint x,
|
||||
|
@ -42,12 +42,7 @@
|
||||
|
||||
#include "gimpdisplay.h"
|
||||
#include "gimpdisplayshell.h"
|
||||
#include "gimpdisplayshell-appearance.h"
|
||||
#include "gimpdisplayshell-close.h"
|
||||
#include "gimpdisplayshell-cursor.h"
|
||||
#include "gimpdisplayshell-scale.h"
|
||||
#include "gimpdisplayshell-scroll.h"
|
||||
#include "gimpdisplayshell-selection.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
@ -310,20 +305,7 @@ gimp_display_shell_really_close (GimpDisplayShell *shell)
|
||||
{
|
||||
GimpContext *user_context;
|
||||
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_OFF);
|
||||
|
||||
gimp_display_set_image (shell->display, NULL);
|
||||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
|
||||
gimp_display_shell_scale (shell, GIMP_ZOOM_TO, 1.0);
|
||||
gimp_display_shell_scroll_clamp_offsets (shell);
|
||||
gimp_display_shell_scale_setup (shell);
|
||||
gimp_display_shell_scaled (shell);
|
||||
|
||||
gimp_display_shell_set_cursor (shell, GIMP_CURSOR_MOUSE,
|
||||
GIMP_TOOL_CURSOR_NONE,
|
||||
GIMP_CURSOR_MODIFIER_NONE);
|
||||
gimp_display_empty (shell->display);
|
||||
|
||||
gimp_ui_manager_update (shell->menubar_manager, shell->display);
|
||||
|
||||
@ -331,8 +313,6 @@ gimp_display_shell_really_close (GimpDisplayShell *shell)
|
||||
|
||||
if (shell->display == gimp_context_get_display (user_context))
|
||||
gimp_ui_manager_update (shell->popup_manager, shell->display);
|
||||
|
||||
gimp_display_shell_appearance_update (shell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -197,6 +197,11 @@ gimp_display_shell_selection_control (GimpDisplayShell *shell,
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (shell->selection)
|
||||
{
|
||||
selection_stop (shell->selection);
|
||||
selection_free_segs (shell->selection);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -67,6 +67,7 @@
|
||||
#include "gimpdisplayshell-handlers.h"
|
||||
#include "gimpdisplayshell-progress.h"
|
||||
#include "gimpdisplayshell-scale.h"
|
||||
#include "gimpdisplayshell-scroll.h"
|
||||
#include "gimpdisplayshell-selection.h"
|
||||
#include "gimpdisplayshell-title.h"
|
||||
#include "gimpdisplayshell-transform.h"
|
||||
@ -92,7 +93,7 @@ enum
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gimp_color_managed_iface_init (GimpColorManagedInterface *iface);
|
||||
static void gimp_color_managed_iface_init (GimpColorManagedInterface *iface);
|
||||
|
||||
static void gimp_display_shell_finalize (GObject *object);
|
||||
static void gimp_display_shell_set_property (GObject *object,
|
||||
@ -1101,8 +1102,48 @@ gimp_display_shell_reconnect (GimpDisplayShell *shell)
|
||||
gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (shell));
|
||||
|
||||
gimp_display_shell_scale_setup (shell);
|
||||
gimp_display_shell_expose_full (shell);
|
||||
gimp_display_shell_scaled (shell);
|
||||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_empty (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
g_return_if_fail (GIMP_IS_DISPLAY (shell->display));
|
||||
g_return_if_fail (shell->display->image == NULL);
|
||||
|
||||
gimp_display_shell_selection_control (shell, GIMP_SELECTION_OFF);
|
||||
|
||||
gimp_display_shell_scale (shell, GIMP_ZOOM_TO, 1.0);
|
||||
gimp_display_shell_scroll_clamp_offsets (shell);
|
||||
gimp_display_shell_scale_setup (shell);
|
||||
gimp_display_shell_scaled (shell);
|
||||
|
||||
gimp_display_shell_appearance_update (shell);
|
||||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_fill (GimpDisplayShell *shell,
|
||||
GimpImage *image,
|
||||
GimpUnit unit,
|
||||
gdouble scale)
|
||||
{
|
||||
gint display_width;
|
||||
gint display_height;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
g_return_if_fail (GIMP_IS_DISPLAY (shell->display));
|
||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||
|
||||
gimp_display_shell_set_unit (shell, unit);
|
||||
gimp_display_shell_set_initial_scale (shell, scale,
|
||||
&display_width, &display_height);
|
||||
|
||||
gimp_display_shell_appearance_update (shell);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -211,6 +211,12 @@ GtkWidget * gimp_display_shell_new (GimpDisplay *display,
|
||||
|
||||
void gimp_display_shell_reconnect (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_empty (GimpDisplayShell *shell);
|
||||
void gimp_display_shell_fill (GimpDisplayShell *shell,
|
||||
GimpImage *image,
|
||||
GimpUnit unit,
|
||||
gdouble scale);
|
||||
|
||||
void gimp_display_shell_scale_changed (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_scaled (GimpDisplayShell *shell);
|
||||
|
@ -59,8 +59,6 @@
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
#include "display/gimpdisplayshell-appearance.h"
|
||||
#include "display/gimpdisplayshell-scale.h"
|
||||
|
||||
#include "actions/plug-in-actions.h"
|
||||
|
||||
@ -298,15 +296,7 @@ gui_display_create (Gimp *gimp,
|
||||
|
||||
if (display)
|
||||
{
|
||||
gint display_width;
|
||||
gint display_height;
|
||||
|
||||
gimp_display_set_image (display, image);
|
||||
gimp_display_shell_set_unit (GIMP_DISPLAY_SHELL (display->shell), unit);
|
||||
gimp_display_shell_set_initial_scale (GIMP_DISPLAY_SHELL (display->shell),
|
||||
scale,
|
||||
&display_width, &display_height);
|
||||
gimp_display_shell_appearance_update (GIMP_DISPLAY_SHELL (display->shell));
|
||||
gimp_display_fill (display, image, unit, scale);
|
||||
|
||||
if (gimp_context_get_display (context) == display)
|
||||
{
|
||||
|
Reference in New Issue
Block a user