gimpchainbutton.h 2.79 KB
Newer Older
1 2
/* LIBGIMP - The GIMP Library
 * 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
Marc Lehmann's avatar
Marc Lehmann committed
8
 * modify it under the terms of the GNU Lesser General Public
9 10
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
11 12 13 14
 *
 * This library 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
15
 * Lesser General Public License for more details.
16
 *
Marc Lehmann's avatar
Marc Lehmann committed
17
 * You should have received a copy of the GNU Lesser General Public
18 19 20 21 22
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

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 27
 * broken chain. It's intented to be used with the GimpSizeEntry
 * widget. The usage is quite similar to the one the GtkToggleButton
28
 * provides.
29 30 31 32 33
 */

#ifndef __GIMP_CHAIN_BUTTON_H__
#define __GIMP_CHAIN_BUTTON_H__

34 35
#include <gtk/gtktable.h>

36
G_BEGIN_DECLS
37

38

39 40 41 42 43 44 45 46 47
typedef enum
{
  GIMP_CHAIN_TOP,
  GIMP_CHAIN_LEFT,
  GIMP_CHAIN_BOTTOM,
  GIMP_CHAIN_RIGHT
} GimpChainPosition;


48
#define GIMP_TYPE_CHAIN_BUTTON            (gimp_chain_button_get_type ())
49 50 51 52
#define GIMP_CHAIN_BUTTON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CHAIN_BUTTON, GimpChainButton))
#define GIMP_CHAIN_BUTTON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHAIN_BUTTON, GimpChainButtonClass))
#define GIMP_IS_CHAIN_BUTTON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CHAIN_BUTTON))
#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 57 58 59
typedef struct _GimpChainButtonClass  GimpChainButtonClass;

struct _GimpChainButton
{
60
  GtkTable           parent_instance;
61 62

  GimpChainPosition  position;
63 64
  gboolean           active;

65 66 67
  GtkWidget         *button;
  GtkWidget         *line1;
  GtkWidget         *line2;
68
  GtkWidget         *image;
69 70 71 72
};

struct _GimpChainButtonClass
{
73
  GtkTableClass  parent_class;
Sven Neumann's avatar
Sven Neumann committed
74

75
  void (* toggled)  (GimpChainButton *button);
76 77 78
};


79
GType       gimp_chain_button_get_type   (void) G_GNUC_CONST;
80

81
GtkWidget * gimp_chain_button_new        (GimpChainPosition  position);
82

83
void        gimp_chain_button_set_active (GimpChainButton   *button,
84
					  gboolean           active);
85
gboolean    gimp_chain_button_get_active (GimpChainButton   *button);
86

87

88
G_END_DECLS
89

90
#endif /* __GIMP_CHAIN_BUTTON_H__ */