info-dialog.h 4.04 KB
Newer Older
Elliot Lee's avatar
Elliot Lee committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/* The GIMP -- an image manipulation program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Elliot Lee's avatar
Elliot Lee committed
17
 */
Sven Neumann's avatar
Sven Neumann committed
18

Elliot Lee's avatar
Elliot Lee committed
19 20 21
#ifndef __INFO_DIALOG_H__
#define __INFO_DIALOG_H__

Sven Neumann's avatar
Sven Neumann committed
22

23 24
typedef enum
{ 
25 26 27 28 29 30 31 32 33 34
  INFO_LABEL,
  INFO_ENTRY,
  INFO_SCALE,
  INFO_SPINBUTTON,
  INFO_SIZEENTRY
} InfoFieldType;

typedef struct _InfoField  InfoField;

struct _InfoField
Elliot Lee's avatar
Elliot Lee committed
35
{
36 37 38
  InfoFieldType  field_type;

  GtkObject     *obj;
39
  gpointer       value_ptr;
40

41
  GCallback      callback;
42
  gpointer       callback_data;
Elliot Lee's avatar
Elliot Lee committed
43 44
};

45
struct _InfoDialog
Elliot Lee's avatar
Elliot Lee committed
46 47 48
{
  GtkWidget   *shell;
  GtkWidget   *vbox;
49
  GtkWidget   *info_table;
50
  GtkWidget   *info_notebook;
Elliot Lee's avatar
Elliot Lee committed
51

52
  GSList      *field_list;
53
  gint         nfields;
Elliot Lee's avatar
Elliot Lee committed
54

55
  gpointer     user_data;
Elliot Lee's avatar
Elliot Lee committed
56 57 58 59
};

/*  Info Dialog functions  */

60 61 62 63 64
InfoDialog *info_dialog_new            (GimpViewable    *viewable,
                                        const gchar     *title,
                                        const gchar     *wmclass_name,
                                        const gchar     *stock_id,
                                        const gchar     *desc,
65 66
					GimpHelpFunc     help_func,
					gpointer         help_data);
67 68 69 70 71
InfoDialog *info_dialog_notebook_new   (GimpViewable    *viewable,
                                        const gchar     *title,
                                        const gchar     *wmclass_name,
                                        const gchar     *stock_id,
                                        const gchar     *desc,
72 73
					GimpHelpFunc     help_func,
					gpointer         help_data);
74 75 76 77 78 79 80 81 82 83 84 85 86 87
void        info_dialog_free           (InfoDialog      *idialog);

void        info_dialog_popup          (InfoDialog      *idialog);
void        info_dialog_popdown        (InfoDialog      *idialog);

void        info_dialog_update         (InfoDialog      *idialog);

GtkWidget  *info_dialog_add_label      (InfoDialog      *idialog,
					gchar           *title,
					gchar           *text_ptr);

GtkWidget  *info_dialog_add_entry      (InfoDialog      *idialog,
					gchar           *title,
					gchar           *text_ptr,
88 89
					GCallback        callback,
					gpointer         callback_data);
90 91 92

GtkWidget  *info_dialog_add_scale      (InfoDialog      *idialog,
					gchar           *title,
93
					gdouble         *value_ptr,
94 95 96 97 98 99
					gfloat           lower,
					gfloat           upper,
					gfloat           step_increment,
					gfloat           page_increment,
					gfloat           page_size,
					gint             digits,
100 101
					GCallback        callback,
					gpointer         callback_data);
102 103 104

GtkWidget  *info_dialog_add_spinbutton (InfoDialog      *idialog,
					gchar           *title,
105
					gdouble         *value_ptr,
106 107 108 109 110 111 112
					gfloat           lower,
					gfloat           upper,
					gfloat           step_increment,
					gfloat           page_increment,
					gfloat           page_size,
					gfloat           climb_rate,
					gint             digits,
113 114
					GCallback        callback,
					gpointer         callback_data);
115 116 117

GtkWidget  *info_dialog_add_sizeentry  (InfoDialog      *idialog,
					gchar           *title,
118
					gdouble         *value_ptr,
119
					gint             nfields,
120
					GimpUnit         unit,
121 122
					gchar           *unit_format,
					gboolean         menu_show_pixels,
Michael Natterer's avatar
Michael Natterer committed
123
					gboolean         menu_show_percent,
124
					gboolean         show_refval,
125
					GimpSizeEntryUpdatePolicy update_policy,
126 127
					GCallback        callback,
					gpointer         callback_data);
Elliot Lee's avatar
Elliot Lee committed
128 129

#endif  /*  __INFO_DIALOG_H__  */