gimpdialog.h 4.47 KB
Newer Older
1
/* LIBGIMP - The GIMP Library
2 3 4
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * gimpdialog.h
5
 * Copyright (C) 2000-2003 Michael Natterer <mitch@gimp.org>
6
 *
7
 * This library is free software: you can redistribute it and/or
8 9
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
10
 * version 3 of the License, or (at your option) any later version.
11 12 13
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 16 17
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with this library.  If not, see
19
 * <https://www.gnu.org/licenses/>.
20
 */
21

22 23 24 25
#if !defined (__GIMP_WIDGETS_H_INSIDE__) && !defined (GIMP_WIDGETS_COMPILATION)
#error "Only <libgimpwidgets/gimpwidgets.h> can be included directly."
#endif

26 27 28
#ifndef __GIMP_DIALOG_H__
#define __GIMP_DIALOG_H__

29
G_BEGIN_DECLS
30

31 32 33
/* For information look into the C source or the html documentation */


34 35 36 37 38 39 40 41
#define GIMP_TYPE_DIALOG            (gimp_dialog_get_type ())
#define GIMP_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DIALOG, GimpDialog))
#define GIMP_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DIALOG, GimpDialogClass))
#define GIMP_IS_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DIALOG))
#define GIMP_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DIALOG))
#define GIMP_DIALOG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DIALOG, GimpDialogClass))


42 43
typedef struct _GimpDialogPrivate GimpDialogPrivate;
typedef struct _GimpDialogClass   GimpDialogClass;
44 45 46

struct _GimpDialog
{
47 48 49
  GtkDialog          parent_instance;

  GimpDialogPrivate *priv;
50 51 52 53 54
};

struct _GimpDialogClass
{
  GtkDialogClass  parent_class;
55 56 57 58 59 60

  /* Padding for future expansion */
  void (* _gimp_reserved1) (void);
  void (* _gimp_reserved2) (void);
  void (* _gimp_reserved3) (void);
  void (* _gimp_reserved4) (void);
61 62 63 64
  void (* _gimp_reserved5) (void);
  void (* _gimp_reserved6) (void);
  void (* _gimp_reserved7) (void);
  void (* _gimp_reserved8) (void);
65 66 67
};


68 69 70 71 72 73 74 75
GType       gimp_dialog_get_type           (void) G_GNUC_CONST;

GtkWidget * gimp_dialog_new                (const gchar    *title,
                                            const gchar    *role,
                                            GtkWidget      *parent,
                                            GtkDialogFlags  flags,
                                            GimpHelpFunc    help_func,
                                            const gchar    *help_id,
76
                                            ...) G_GNUC_NULL_TERMINATED;
77 78 79 80 81 82 83 84 85

GtkWidget * gimp_dialog_new_valist         (const gchar    *title,
                                            const gchar    *role,
                                            GtkWidget      *parent,
                                            GtkDialogFlags  flags,
                                            GimpHelpFunc    help_func,
                                            const gchar    *help_id,
                                            va_list         args);

86 87 88 89 90
GtkWidget * gimp_dialog_add_button         (GimpDialog     *dialog,
                                            const gchar    *button_text,
                                            gint            response_id);
void        gimp_dialog_add_buttons        (GimpDialog     *dialog,
                                            ...) G_GNUC_NULL_TERMINATED;
91 92
void        gimp_dialog_add_buttons_valist (GimpDialog     *dialog,
                                            va_list         args);
93

94 95
gint        gimp_dialog_run                (GimpDialog     *dialog);

96 97 98
/*  for internal use only!  */
void        gimp_dialogs_show_help_button  (gboolean        show);

99

100 101 102 103 104 105 106 107 108 109 110 111 112 113
/*  since we don't know yet what to do about alternative button order,
 *  just hide the warnings for now...
 */
#define gimp_dialog_set_alternative_button_order(d,f...) \
  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;                      \
  gtk_dialog_set_alternative_button_order(d,f);          \
  G_GNUC_END_IGNORE_DEPRECATIONS;

#define gimp_dialog_set_alternative_button_order_from_array(d,n,o) \
  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;                                \
  gtk_dialog_set_alternative_button_order_from_array(d,n,o);       \
  G_GNUC_END_IGNORE_DEPRECATIONS;


114
G_END_DECLS
115

116
#endif /* __GIMP_DIALOG_H__ */