예제 #1
0
GimpProgress *
gimp_progress_start (GimpProgress *progress,
                     gboolean      cancellable,
                     const gchar  *format,
                     ...)
{
  GimpProgressInterface *progress_iface;

  g_return_val_if_fail (GIMP_IS_PROGRESS (progress), NULL);
  g_return_val_if_fail (format != NULL, NULL);

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->start)
    {
      GimpProgress *ret;
      va_list       args;
      gchar        *text;

      va_start (args, format);
      text = g_strdup_vprintf (format, args);
      va_end (args);

      ret = progress_iface->start (progress, cancellable, text);

      g_free (text);

      return ret;
    }

  return NULL;
}
예제 #2
0
void
gimp_progress_pulse (GimpProgress *progress)
{
  GimpProgressInterface *progress_iface;

  g_return_if_fail (GIMP_IS_PROGRESS (progress));

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->pulse)
    progress_iface->pulse (progress);
}
예제 #3
0
guint32
gimp_progress_get_window_id (GimpProgress *progress)
{
  GimpProgressInterface *progress_iface;

  g_return_val_if_fail (GIMP_IS_PROGRESS (progress), 0);

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->get_window_id)
    return progress_iface->get_window_id (progress);

  return 0;
}
예제 #4
0
gdouble
gimp_progress_get_value (GimpProgress *progress)
{
  GimpProgressInterface *progress_iface;

  g_return_val_if_fail (GIMP_IS_PROGRESS (progress), 0.0);

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->get_value)
    return progress_iface->get_value (progress);

  return 0.0;
}
예제 #5
0
void
gimp_progress_set_text_literal (GimpProgress *progress,
                                const gchar  *message)
{
  GimpProgressInterface *progress_iface;

  g_return_if_fail (GIMP_IS_PROGRESS (progress));
  g_return_if_fail (message != NULL);

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->set_text)
    progress_iface->set_text (progress, message);
}
예제 #6
0
gboolean
gimp_progress_is_active (GimpProgress *progress)
{
  GimpProgressInterface *progress_iface;

  g_return_val_if_fail (GIMP_IS_PROGRESS (progress), FALSE);

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->is_active)
    return progress_iface->is_active (progress);

  return FALSE;
}
예제 #7
0
void
gimp_progress_set_value (GimpProgress *progress,
                         gdouble       percentage)
{
  GimpProgressInterface *progress_iface;

  g_return_if_fail (GIMP_IS_PROGRESS (progress));

  percentage = CLAMP (percentage, 0.0, 1.0);

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->set_value)
    progress_iface->set_value (progress, percentage);
}
예제 #8
0
void
gimp_progress_set_text (GimpProgress *progress,
                        const gchar  *message)
{
  GimpProgressInterface *progress_iface;

  g_return_if_fail (GIMP_IS_PROGRESS (progress));

  if (! message || ! strlen (message))
    message = _("Please wait");

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->set_text)
    progress_iface->set_text (progress, message);
}
예제 #9
0
GimpProgress *
gimp_progress_start (GimpProgress *progress,
                     const gchar  *message,
                     gboolean      cancelable)
{
  GimpProgressInterface *progress_iface;

  g_return_val_if_fail (GIMP_IS_PROGRESS (progress), NULL);

  if (! message)
    message = _("Please wait");

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->start)
    return progress_iface->start (progress, message, cancelable);

  return NULL;
}
예제 #10
0
gboolean
gimp_progress_message (GimpProgress        *progress,
                       Gimp                *gimp,
                       GimpMessageSeverity  severity,
                       const gchar         *domain,
                       const gchar         *message)
{
  GimpProgressInterface *progress_iface;

  g_return_val_if_fail (GIMP_IS_PROGRESS (progress), FALSE);
  g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
  g_return_val_if_fail (domain != NULL, FALSE);
  g_return_val_if_fail (message != NULL, FALSE);

  progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);

  if (progress_iface->message)
    return progress_iface->message (progress, gimp, severity, domain, message);

  return FALSE;
}