1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1999 Manish Singh
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
#include "libgimpwidgets/gimpwidgets.h"
25
#include "display-types.h"
27
#include "gimpdisplayshell.h"
28
#include "gimpdisplayshell-filter.h"
31
/* local function prototypes */
33
static void gimp_display_shell_filter_changed (GimpColorDisplayStack *stack,
34
GimpDisplayShell *shell);
37
/* public functions */
40
gimp_display_shell_filter_set (GimpDisplayShell *shell,
41
GimpColorDisplayStack *stack)
43
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
44
g_return_if_fail (stack == NULL || GIMP_IS_COLOR_DISPLAY_STACK (stack));
46
if (stack == shell->filter_stack)
49
if (shell->filter_stack)
51
g_signal_handlers_disconnect_by_func (shell->filter_stack,
52
gimp_display_shell_filter_changed,
55
g_object_unref (shell->filter_stack);
58
shell->filter_stack = stack;
60
if (shell->filter_stack)
62
g_object_ref (shell->filter_stack);
64
g_signal_connect (shell->filter_stack, "changed",
65
G_CALLBACK (gimp_display_shell_filter_changed),
69
gimp_display_shell_filter_changed (NULL, shell);
73
/* private functions */
76
gimp_display_shell_filter_changed_idle (gpointer data)
78
GimpDisplayShell *shell = data;
80
gimp_display_shell_expose_full (shell);
81
shell->filter_idle_id = 0;
87
gimp_display_shell_filter_changed (GimpColorDisplayStack *stack,
88
GimpDisplayShell *shell)
90
if (shell->filter_idle_id)
91
g_source_remove (shell->filter_idle_id);
93
shell->filter_idle_id =
94
g_idle_add_full (G_PRIORITY_LOW,
95
gimp_display_shell_filter_changed_idle,