]> git.sur5r.net Git - glabels/blob - src/wdgt-chain-button.h
Imported Upstream version 3.0.0
[glabels] / src / wdgt-chain-button.h
1 /*
2  *  wdgt-chain-button.h
3  *  Modified version of gimpchainbutton.h for gLabels:
4  *
5  *  LIBGIMP - The GIMP Library
6  *  Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
7  *
8  *  gimpchainbutton.h
9  *  Copyright (C) 1999-2000 Sven Neumann <sven@gimp.org>
10  *
11  *  Modified or gLabels by Jim Evins <evins@snaught.com>
12  *
13  *
14  *  This file is part of gLabels.
15  *
16  *  gLabels is free software: you can redistribute it and/or modify
17  *  it under the terms of the GNU General Public License as published by
18  *  the Free Software Foundation, either version 3 of the License, or
19  *  (at your option) any later version.
20  *
21  *  gLabels is distributed in the hope that it will be useful,
22  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  *  GNU General Public License for more details.
25  *
26  *  You should have received a copy of the GNU General Public License
27  *  along with gLabels.  If not, see <http://www.gnu.org/licenses/>.
28  */
29
30 /*
31  * This implements a widget derived from GtkTable that visualizes
32  * it's state with two different pixmaps showing a closed and a
33  * broken chain. It's intented to be used with the GimpSizeEntry
34  * widget. The usage is quite similar to the one the GtkToggleButton
35  * provides.
36  */
37
38 #ifndef __WDGT_CHAIN_BUTTON_H__
39 #define __WDGT_CHAIN_BUTTON_H__
40
41 #include <gtk/gtk.h>
42
43 G_BEGIN_DECLS
44
45
46 typedef enum
47 {
48   GL_WDGT_CHAIN_TOP,
49   GL_WDGT_CHAIN_LEFT,
50   GL_WDGT_CHAIN_BOTTOM,
51   GL_WDGT_CHAIN_RIGHT
52 } glWdgtChainPosition;
53
54
55 #define GL_WDGT_TYPE_CHAIN_BUTTON            (gl_wdgt_chain_button_get_type ())
56 #define GL_WDGT_CHAIN_BUTTON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_WDGT_TYPE_CHAIN_BUTTON, glWdgtChainButton))
57 #define GL_WDGT_CHAIN_BUTTON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GL_WDGT_TYPE_CHAIN_BUTTON, glWdgtChainButtonClass))
58 #define GL_WDGT_IS_CHAIN_BUTTON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_WDGT_TYPE_CHAIN_BUTTON))
59 #define GL_WDGT_IS_CHAIN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_WDGT_TYPE_CHAIN_BUTTON))
60 #define GL_WDGT_CHAIN_BUTTON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GL_WDGT_TYPE_CHAIN_BUTTON, glWdgtChainButtonClass))
61
62
63 typedef struct _glWdgtChainButton       glWdgtChainButton;
64 typedef struct _glWdgtChainButtonClass  glWdgtChainButtonClass;
65
66 struct _glWdgtChainButton
67 {
68   GtkTable           parent_instance;
69
70   glWdgtChainPosition  position;
71   gboolean           active;
72
73   GtkWidget         *button;
74   GtkWidget         *line1;
75   GtkWidget         *line2;
76   GtkWidget         *image;
77 };
78
79 struct _glWdgtChainButtonClass
80 {
81   GtkTableClass  parent_class;
82
83   void (* toggled)  (glWdgtChainButton *button);
84 };
85
86
87 GType       gl_wdgt_chain_button_get_type   (void) G_GNUC_CONST;
88
89 GtkWidget * gl_wdgt_chain_button_new        (glWdgtChainPosition  position);
90
91 void        gl_wdgt_chain_button_set_active (glWdgtChainButton   *button,
92                                              gboolean             active);
93 gboolean    gl_wdgt_chain_button_get_active (glWdgtChainButton   *button);
94
95
96 G_END_DECLS
97
98 #endif /* __WDGT_CHAIN_BUTTON_H__ */
99
100
101
102 /*
103  * Local Variables:       -- emacs
104  * mode: C                -- emacs
105  * c-basic-offset: 8      -- emacs
106  * tab-width: 8           -- emacs
107  * indent-tabs-mode: nil  -- emacs
108  * End:                   -- emacs
109  */