home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 February / CMCD0205.ISO / Linux / gimp-2.2.0.tar.gz / gimp-2.2.0.tar / gimp-2.2.0 / libgimpwidgets / gimpchainbutton.h < prev    next >
C/C++ Source or Header  |  2004-01-28  |  3KB  |  97 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpchainbutton.h
  5.  * Copyright (C) 1999-2000 Sven Neumann <sven@gimp.org>
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2 of the License, or (at your option) any later version.
  11.  *
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the
  19.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  * Boston, MA 02111-1307, USA.
  21.  */
  22.  
  23. /*
  24.  * This implements a widget derived from GtkTable that visualizes
  25.  * it's state with two different pixmaps showing a closed and a
  26.  * broken chain. It's intented to be used with the GimpSizeEntry
  27.  * widget. The usage is quite similar to the one the GtkToggleButton
  28.  * provides.
  29.  */
  30.  
  31. #ifndef __GIMP_CHAIN_BUTTON_H__
  32. #define __GIMP_CHAIN_BUTTON_H__
  33.  
  34. #include <gtk/gtktable.h>
  35.  
  36. G_BEGIN_DECLS
  37.  
  38.  
  39. typedef enum
  40. {
  41.   GIMP_CHAIN_TOP,
  42.   GIMP_CHAIN_LEFT,
  43.   GIMP_CHAIN_BOTTOM,
  44.   GIMP_CHAIN_RIGHT
  45. } GimpChainPosition;
  46.  
  47.  
  48. #define GIMP_TYPE_CHAIN_BUTTON            (gimp_chain_button_get_type ())
  49. #define GIMP_CHAIN_BUTTON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CHAIN_BUTTON, GimpChainButton))
  50. #define GIMP_CHAIN_BUTTON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHAIN_BUTTON, GimpChainButtonClass))
  51. #define GIMP_IS_CHAIN_BUTTON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CHAIN_BUTTON))
  52. #define GIMP_IS_CHAIN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHAIN_BUTTON))
  53. #define GIMP_CHAIN_BUTTON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CHAIN_BUTTON, GimpChainButtonClass))
  54.  
  55.  
  56. typedef struct _GimpChainButtonClass  GimpChainButtonClass;
  57.  
  58. struct _GimpChainButton
  59. {
  60.   GtkTable           parent_instance;
  61.  
  62.   GimpChainPosition  position;
  63.   gboolean           active;
  64.  
  65.   GtkWidget         *button;
  66.   GtkWidget         *line1;
  67.   GtkWidget         *line2;
  68.   GtkWidget         *image;
  69. };
  70.  
  71. struct _GimpChainButtonClass
  72. {
  73.   GtkTableClass  parent_class;
  74.  
  75.   void (* toggled)  (GimpChainButton *button);
  76.  
  77.   /* Padding for future expansion */
  78.   void (* _gimp_reserved1) (void);
  79.   void (* _gimp_reserved2) (void);
  80.   void (* _gimp_reserved3) (void);
  81.   void (* _gimp_reserved4) (void);
  82. };
  83.  
  84.  
  85. GType       gimp_chain_button_get_type   (void) G_GNUC_CONST;
  86.  
  87. GtkWidget * gimp_chain_button_new        (GimpChainPosition  position);
  88.  
  89. void        gimp_chain_button_set_active (GimpChainButton   *button,
  90.                       gboolean           active);
  91. gboolean    gimp_chain_button_get_active (GimpChainButton   *button);
  92.  
  93.  
  94. G_END_DECLS
  95.  
  96. #endif /* __GIMP_CHAIN_BUTTON_H__ */
  97.