gimpprogress.h 3.54 KB
Newer Older
1 2 3 4 5
/* LIBGIMP - The GIMP Library
 * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
 *
 * gimpprogress.h
 *
6
 * This library is free software: you can redistribute it and/or
7 8
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
9
 * version 3 of the License, or (at your option) any later version.
10 11 12 13 14 15 16
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with this library.  If not, see
18
 * <https://www.gnu.org/licenses/>.
19 20
 */

21 22 23 24
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
#error "Only <libgimp/gimp.h> can be included directly."
#endif

25 26 27 28 29 30
#ifndef __GIMP_PROGRESS_H__
#define __GIMP_PROGRESS_H__

G_BEGIN_DECLS


31 32
typedef struct _GimpProgressVtable GimpProgressVtable;

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
/**
 * GimpProgressVtable:
 * @start:      starts the progress.
 * @end:        ends the progress.
 * @set_text:   sets a new text on the progress.
 * @set_value:  sets a new percentage on the progress.
 * @pulse:      makes the progress pulse.
 * @get_window: returns the ID of the window where the progress is displayed.
 * @_gimp_reserved1: reserved pointer for future expansion.
 * @_gimp_reserved2: reserved pointer for future expansion.
 * @_gimp_reserved3: reserved pointer for future expansion.
 * @_gimp_reserved4: reserved pointer for future expansion.
 * @_gimp_reserved5: reserved pointer for future expansion.
 * @_gimp_reserved6: reserved pointer for future expansion.
 * @_gimp_reserved7: reserved pointer for future expansion.
 * @_gimp_reserved8: reserved pointer for future expansion.
 **/
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
struct _GimpProgressVtable
{
  void    (* start)        (const gchar *message,
                            gboolean     cancelable,
                            gpointer     user_data);
  void    (* end)          (gpointer     user_data);
  void    (* set_text)     (const gchar *message,
                            gpointer     user_data);
  void    (* set_value)    (gdouble      percentage,
                            gpointer     user_data);
  void    (* pulse)        (gpointer     user_data);

  guint32 (* get_window)   (gpointer     user_data);

  /* Padding for future expansion. Must be initialized with NULL! */
  void (* _gimp_reserved1) (void);
  void (* _gimp_reserved2) (void);
  void (* _gimp_reserved3) (void);
  void (* _gimp_reserved4) (void);
  void (* _gimp_reserved5) (void);
  void (* _gimp_reserved6) (void);
  void (* _gimp_reserved7) (void);
  void (* _gimp_reserved8) (void);
};

75

76
const gchar * gimp_progress_install_vtable  (const GimpProgressVtable *vtable,
77 78 79
                                             gpointer                  user_data,
                                             GDestroyNotify            user_data_destroy);
void          gimp_progress_uninstall       (const gchar              *progress_callback);
80

81
gboolean      gimp_progress_init            (const gchar              *message);
82 83
gboolean      gimp_progress_init_printf     (const gchar              *format,
                                             ...) G_GNUC_PRINTF (1, 2);
84

85 86
gboolean      gimp_progress_set_text_printf (const gchar              *format,
                                             ...) G_GNUC_PRINTF (1, 2);
87

88 89
gboolean      gimp_progress_update          (gdouble                   percentage);

90

91 92 93
G_END_DECLS

#endif /* __GIMP_PROGRESS_H__ */