mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-21 20:12:30 +00:00
32bc599dc3
2003-11-21 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolordisplaystack.h: forgot to declare gimp_color_display_stack_clone(). * app/display/gimpdisplayshell.[ch]: replaced the GList of GimpColorDisplays by a single GimpColorDisplayStack. * app/display/gimpdisplayshell-render.c (gimp_display_shell_render): changed accordingly. * app/display/gimpdisplayshell-filter.[ch]: reduced API to a single function, gimp_display_shell_filter_set(), which exchanges the whole filter stack. Idle update the display on GimpColorDisplayStack::update(). * app/display/gimpdisplayshell-filter-dialog.[ch]: changed accordingly. Return the created dialog instead of assigning shell->filters_dialog. * app/gui/view-commands.c (view_display_filters_cmd_callback): set shell->filters_dialog here and raise it it if already exists. Don't use the dialog factory to create it because it's a transient dialog for the display which does not need to be session managed. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs.c: removed display filter dialog stuff.
98 lines
2.7 KiB
C
98 lines
2.7 KiB
C
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1999 Manish Singh
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
#include "display-types.h"
|
|
|
|
#include "gimpdisplayshell.h"
|
|
#include "gimpdisplayshell-filter.h"
|
|
|
|
|
|
/* local function prototypes */
|
|
|
|
static void gimp_display_shell_filter_changed (GimpColorDisplayStack *stack,
|
|
GimpDisplayShell *shell);
|
|
|
|
|
|
/* public functions */
|
|
|
|
void
|
|
gimp_display_shell_filter_set (GimpDisplayShell *shell,
|
|
GimpColorDisplayStack *stack)
|
|
{
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
g_return_if_fail (stack == NULL || GIMP_IS_COLOR_DISPLAY_STACK (stack));
|
|
|
|
if (stack == shell->filter_stack)
|
|
return;
|
|
|
|
if (shell->filter_stack)
|
|
{
|
|
g_signal_handlers_disconnect_by_func (shell->filter_stack,
|
|
gimp_display_shell_filter_changed,
|
|
shell);
|
|
|
|
g_object_unref (shell->filter_stack);
|
|
}
|
|
|
|
shell->filter_stack = stack;
|
|
|
|
if (shell->filter_stack)
|
|
{
|
|
g_object_ref (shell->filter_stack);
|
|
|
|
g_signal_connect (shell->filter_stack, "changed",
|
|
G_CALLBACK (gimp_display_shell_filter_changed),
|
|
shell);
|
|
}
|
|
|
|
gimp_display_shell_filter_changed (NULL, shell);
|
|
}
|
|
|
|
|
|
/* private functions */
|
|
|
|
static gboolean
|
|
gimp_display_shell_filter_changed_idle (gpointer data)
|
|
{
|
|
GimpDisplayShell *shell = data;
|
|
|
|
gimp_display_shell_expose_full (shell);
|
|
shell->filter_idle_id = 0;
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
static void
|
|
gimp_display_shell_filter_changed (GimpColorDisplayStack *stack,
|
|
GimpDisplayShell *shell)
|
|
{
|
|
if (shell->filter_idle_id)
|
|
g_source_remove (shell->filter_idle_id);
|
|
|
|
shell->filter_idle_id =
|
|
g_idle_add_full (G_PRIORITY_LOW,
|
|
gimp_display_shell_filter_changed_idle,
|
|
shell, NULL);
|
|
}
|