1 /*
2  * GNT - The GLib Ncurses Toolkit
3  *
4  * GNT is the legal property of its developers, whose names are too numerous
5  * to list here.  Please refer to the COPYRIGHT file distributed with this
6  * source distribution.
7  *
8  * This library is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
21  */
22 
23 #ifndef GNT_LINE_H
24 #define GNT_LINE_H
25 /**
26  * SECTION:gntline
27  * @section_id: libgnt-gntline
28  * @title: GntLine
29  * @short_description: A widget that draws a horizontal or vertical line
30  */
31 
32 #include "gnt.h"
33 #include "gntcolors.h"
34 #include "gntkeys.h"
35 #include "gntwidget.h"
36 
37 #define GNT_TYPE_LINE				(gnt_line_get_gtype())
38 #define GNT_LINE(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_LINE, GntLine))
39 #define GNT_LINE_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_LINE, GntLineClass))
40 #define GNT_IS_LINE(obj)			(G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_LINE))
41 #define GNT_IS_LINE_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_LINE))
42 #define GNT_LINE_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_LINE, GntLineClass))
43 
44 #ifndef GNT_DISABLE_DEPRECATED
45 /**
46  * GNT_LINE_FLAGS:
47  *
48  * Deprecated: 2.14.0: This is an internal implementation detail.
49  */
50 #define GNT_LINE_FLAGS(obj)				(GNT_LINE(obj)->priv.flags)
51 /**
52  * GNT_LINE_SET_FLAGS:
53  *
54  * Deprecated: 2.14.0: This is an internal implementation detail.
55  */
56 #define GNT_LINE_SET_FLAGS(obj, flags)		(GNT_LINE_FLAGS(obj) |= flags)
57 /**
58  * GNT_LINE_UNSET_FLAGS:
59  *
60  * Deprecated: 2.14.0: This is an internal implementation detail.
61  */
62 #define GNT_LINE_UNSET_FLAGS(obj, flags)	(GNT_LINE_FLAGS(obj) &= ~(flags))
63 #endif
64 
65 typedef struct _GntLine			GntLine;
66 typedef struct _GntLineClass		GntLineClass;
67 #ifndef GNT_DISABLE_DEPRECATED
68 /**
69  * GntLinePriv:
70  *
71  * Deprecated: 2.14.0: This is an internal implementation detail.
72  */
73 typedef struct _GntLinePriv GntLinePriv;
74 #endif
75 
76 /**
77  * GntLine:
78  *
79  * Access to any fields is deprecated. See inline comments for replacements.
80  */
81 struct _GntLine
82 {
83 	GntWidget parent;
84 
85 	gboolean GNTSEAL(vertical);
86 };
87 
88 struct _GntLineClass
89 {
90 	GntWidgetClass parent;
91 
92 	/*< private >*/
93 	void (*gnt_reserved1)(void);
94 	void (*gnt_reserved2)(void);
95 	void (*gnt_reserved3)(void);
96 	void (*gnt_reserved4)(void);
97 };
98 
99 G_BEGIN_DECLS
100 
101 /**
102  * gnt_line_get_gtype:
103  *
104  * Returns: GType for GntLine.
105  */
106 GType gnt_line_get_gtype(void);
107 
108 #define gnt_hline_new() gnt_line_new(FALSE)
109 #define gnt_vline_new() gnt_line_new(TRUE)
110 
111 /**
112  * gnt_line_new:
113  * @vertical:  %TRUE if the line should be vertical, %FALSE for a horizontal line.
114  *
115  * Create new line
116  *
117  * Returns:  The newly created line.
118  */
119 GntWidget * gnt_line_new(gboolean vertical);
120 
121 G_END_DECLS
122 
123 #endif /* GNT_LINE_H */
124