histogramwidget.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 __HISTOGRAM_WIDGET_H__
  19. #define __HISTOGRAM_WIDGET_H__
  20. #include <gtk/gtkdrawingarea.h>
  21. #include "gimphistogram.h"
  22. #define HISTOGRAM_WIDGET_TYPE (histogram_widget_get_type ())
  23. #define HISTOGRAM_WIDGET(obj) GTK_CHECK_CAST (obj, histogram_widget_get_type (), HistogramWidget)
  24. #define HISTOGRAM_WIDGET_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, histogram_widget_get_type (), HistogramWidget)
  25. #define IS_HISTOGRAM_WIDGET(obj) GTK_CHECK_TYPE (obj, histogram_widget_get_type ())
  26. typedef struct _HistogramWidget HistogramWidget;
  27. typedef struct _HistogramWidgetClass HistogramWidgetClass;
  28. /* HistogramWidget signals:
  29. range_changed
  30. */
  31. struct _HistogramWidget
  32. {
  33. GtkDrawingArea drawingarea;
  34. GimpHistogram *histogram;
  35. GimpHistogramChannel channel;
  36. gint start;
  37. gint end;
  38. };
  39. struct _HistogramWidgetClass
  40. {
  41. GtkDrawingAreaClass parent_class;
  42. void (* range_changed) (HistogramWidget *hw,
  43. gint start,
  44. gint end);
  45. };
  46. /* Histogram functions */
  47. GtkType histogram_widget_get_type (void);
  48. HistogramWidget * histogram_widget_new (gint width,
  49. gint height);
  50. void histogram_widget_update (HistogramWidget *hw,
  51. GimpHistogram *histogram);
  52. void histogram_widget_range (HistogramWidget *hw,
  53. gint start,
  54. gint end);
  55. void histogram_widget_channel (HistogramWidget *hw,
  56. gint channel);
  57. GimpHistogram * histogram_widget_histogram (HistogramWidget *hw);
  58. #endif /* __HISTOGRAM_WIDGET_H__ */