info_dialog.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /* The GIMP -- an image manipulation program
  2. * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. *
  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.
  8. *
  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.
  13. *
  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.
  17. */
  18. #ifndef __INFO_DIALOG_H__
  19. #define __INFO_DIALOG_H__
  20. #include "gimphelp.h"
  21. #include "libgimp/gimpsizeentry.h"
  22. #include "libgimp/gimpunit.h"
  23. typedef enum
  24. {
  25. INFO_LABEL,
  26. INFO_ENTRY,
  27. INFO_SCALE,
  28. INFO_SPINBUTTON,
  29. INFO_SIZEENTRY
  30. } InfoFieldType;
  31. typedef struct _InfoField InfoField;
  32. typedef struct _InfoDialog InfoDialog;
  33. struct _InfoField
  34. {
  35. InfoFieldType field_type;
  36. GtkObject *obj;
  37. void *value_ptr;
  38. GtkSignalFunc callback;
  39. gpointer client_data;
  40. };
  41. struct _InfoDialog
  42. {
  43. GtkWidget *shell;
  44. GtkWidget *vbox;
  45. GtkWidget *info_table;
  46. GtkWidget *info_notebook;
  47. GSList *field_list;
  48. gint nfields;
  49. void *user_data;
  50. };
  51. /* Info Dialog functions */
  52. InfoDialog *info_dialog_new (gchar *title,
  53. GimpHelpFunc help_func,
  54. gpointer help_data);
  55. InfoDialog *info_dialog_notebook_new (gchar *title,
  56. GimpHelpFunc help_func,
  57. gpointer help_data);
  58. void info_dialog_free (InfoDialog *idialog);
  59. void info_dialog_popup (InfoDialog *idialog);
  60. void info_dialog_popdown (InfoDialog *idialog);
  61. void info_dialog_update (InfoDialog *idialog);
  62. GtkWidget *info_dialog_add_label (InfoDialog *idialog,
  63. gchar *title,
  64. gchar *text_ptr);
  65. GtkWidget *info_dialog_add_entry (InfoDialog *idialog,
  66. gchar *title,
  67. gchar *text_ptr,
  68. GtkSignalFunc callback,
  69. gpointer data);
  70. GtkWidget *info_dialog_add_scale (InfoDialog *idialog,
  71. gchar *title,
  72. gdouble *value_ptr,
  73. gfloat lower,
  74. gfloat upper,
  75. gfloat step_increment,
  76. gfloat page_increment,
  77. gfloat page_size,
  78. gint digits,
  79. GtkSignalFunc callback,
  80. gpointer data);
  81. GtkWidget *info_dialog_add_spinbutton (InfoDialog *idialog,
  82. gchar *title,
  83. gdouble *value_ptr,
  84. gfloat lower,
  85. gfloat upper,
  86. gfloat step_increment,
  87. gfloat page_increment,
  88. gfloat page_size,
  89. gfloat climb_rate,
  90. gint digits,
  91. GtkSignalFunc callback,
  92. gpointer data);
  93. GtkWidget *info_dialog_add_sizeentry (InfoDialog *idialog,
  94. gchar *title,
  95. gdouble *value_ptr,
  96. gint nfields,
  97. GimpUnit unit,
  98. gchar *unit_format,
  99. gboolean menu_show_pixels,
  100. gboolean menu_show_percent,
  101. gboolean show_refval,
  102. GimpSizeEntryUpdatePolicy update_policy,
  103. GtkSignalFunc callback,
  104. gpointer data);
  105. #endif /* __INFO_DIALOG_H__ */