1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
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 "display-types.h"
25
#include "core/gimpprogress.h"
27
#include "widgets/gimpwidgets-utils.h"
29
#include "gimpdisplayshell.h"
30
#include "gimpdisplayshell-progress.h"
31
#include "gimpstatusbar.h"
35
gimp_display_shell_progress_start (GimpProgress *progress,
39
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
41
return gimp_progress_start (GIMP_PROGRESS (shell->statusbar),
46
gimp_display_shell_progress_end (GimpProgress *progress)
48
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
50
gimp_progress_end (GIMP_PROGRESS (shell->statusbar));
54
gimp_display_shell_progress_is_active (GimpProgress *progress)
56
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
58
return gimp_progress_is_active (GIMP_PROGRESS (shell->statusbar));
62
gimp_display_shell_progress_set_text (GimpProgress *progress,
65
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
67
gimp_progress_set_text (GIMP_PROGRESS (shell->statusbar), message);
71
gimp_display_shell_progress_set_value (GimpProgress *progress,
74
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
76
gimp_progress_set_value (GIMP_PROGRESS (shell->statusbar), percentage);
80
gimp_display_shell_progress_get_value (GimpProgress *progress)
82
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
84
return gimp_progress_get_value (GIMP_PROGRESS (shell->statusbar));
88
gimp_display_shell_progress_pulse (GimpProgress *progress)
90
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
92
gimp_progress_pulse (GIMP_PROGRESS (shell->statusbar));
96
gimp_display_shell_progress_get_window (GimpProgress *progress)
98
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
100
return (guint32) gimp_window_get_native (GTK_WINDOW (shell));
104
gimp_display_shell_progress_message (GimpProgress *progress,
106
GimpMessageSeverity severity,
108
const gchar *message)
110
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
114
case GIMP_MESSAGE_ERROR:
115
/* error messages are never handled here */
118
case GIMP_MESSAGE_WARNING:
119
/* warning messages go to the statusbar, if it's visible */
120
if (! GTK_WIDGET_VISIBLE (shell->statusbar))
122
/* else fallthrough */
124
case GIMP_MESSAGE_INFO:
125
/* info messages go to the statusbar, no matter if it's visible or not */
126
return gimp_progress_message (GIMP_PROGRESS (shell->statusbar), gimp,
127
severity, domain, message);
134
gimp_display_shell_progress_iface_init (GimpProgressInterface *iface)
136
iface->start = gimp_display_shell_progress_start;
137
iface->end = gimp_display_shell_progress_end;
138
iface->is_active = gimp_display_shell_progress_is_active;
139
iface->set_text = gimp_display_shell_progress_set_text;
140
iface->set_value = gimp_display_shell_progress_set_value;
141
iface->get_value = gimp_display_shell_progress_get_value;
142
iface->pulse = gimp_display_shell_progress_pulse;
143
iface->get_window = gimp_display_shell_progress_get_window;
144
iface->message = gimp_display_shell_progress_message;