home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / gimpset.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-12-17  |  2.6 KB  |  77 lines

  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.  
  19. #ifndef __GIMP_SET_H__
  20. #define __GIMP_SET_H__
  21.  
  22.  
  23. /* GimpSet - a (usually) typed set of objects with signals for adding
  24.  * and removing of stuff. If it is weak, destroyed objects get removed
  25.  * automatically. If it is not, it refs them so they won't be freed
  26.  * till they are removed. (Though they can be destroyed, of course).
  27.  *
  28.  * If GTK_TYPE_NONE is specified at gimpset creation time, no type
  29.  * checking is performed by gimp_set_add() and the
  30.  * gimp_set_{add,remove}_handler() functions should not be used.  It
  31.  * is also illegal to ask for a weak untyped gimpset.
  32. */
  33.  
  34. #define GIMP_TYPE_SET    gimp_set_get_type ()
  35. #define GIMP_SET(obj)    GTK_CHECK_CAST (obj, GIMP_TYPE_SET, GimpSet)
  36. #define GIMP_IS_SET(obj) GTK_CHECK_TYPE (obj, gimp_set_get_type())
  37.  
  38. /* Signals:
  39.    add
  40.    remove
  41.    active_changed
  42. */
  43.  
  44. typedef guint GimpSetHandlerId;
  45.  
  46. GtkType         gimp_set_get_type   (void);
  47. GimpSet       * gimp_set_new        (GtkType   type,
  48.                      gboolean  weak);
  49.  
  50. GtkType        gimp_set_type        (GimpSet  *set);
  51.  
  52. gboolean           gimp_set_add        (GimpSet  *gimpset,
  53.                      gpointer  object);
  54. gboolean           gimp_set_remove        (GimpSet  *gimpset,
  55.                      gpointer  object);
  56.  
  57. gboolean    gimp_set_have        (GimpSet  *gimpset,
  58.                      gpointer  object);
  59. void        gimp_set_foreach    (GimpSet  *gimpset,
  60.                      GFunc     func,
  61.                      gpointer  user_data);
  62. gint        gimp_set_size        (GimpSet  *gimpset);
  63.  
  64. void        gimp_set_set_active (GimpSet  *gimpset,
  65.                      gpointer  object);
  66. gpointer    gimp_set_get_active (GimpSet  *gimpset);
  67.  
  68. GimpSetHandlerId gimp_set_add_handler   (GimpSet          *set,
  69.                      const gchar      *signame,
  70.                      GtkSignalFunc     handler,
  71.                      gpointer          user_data);
  72. void        gimp_set_remove_handler (GimpSet          *set,
  73.                      GimpSetHandlerId  id);
  74.  
  75.  
  76. #endif /* __GIMP_SET_H__ */
  77.