Debian Codegraph @

src/modules/frontend/gtk/align_text_renderer.h

raw
1 /*****************************************************************************
2 *
3 * cdebconf - An implementation of the Debian Configuration Management
4 * System
5 *
6 * cdebconf is (c) 2000-2007 Randolph Chung and others under the following
7 * license.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 *****************************************************************************/
33
34 /** @file align_text_renderer.h
35 * GtkCellRenderer for text aligned with tab stops (header)
36 */
37
38 #ifndef _ALIGN_TEXT_RENDERER_H_
39 #define _ALIGN_TEXT_RENDERER_H_
40
41 #include <gtk/gtk.h>
42
43 #define ALIGN_CENTER_STRING "\xe2\x80\x84"
44 #define ALIGN_CENTER_GLYPH ((PangoGlyph) 0xa8e)
45 #define ALIGN_RIGHT_STRING "\xe2\x80\x85"
46 #define ALIGN_RIGHT_GLYPH ((PangoGlyph) 0xa8f)
47
48 #define TYPE_ALIGN_TEXT_RENDERER (cdebconf_gtk_align_text_renderer_get_type())
49
50 #define ALIGN_TEXT_RENDERER(obj) \
51 (G_TYPE_CHECK_INSTANCE_CAST( \
52 (obj), TYPE_ALIGN_TEXT_RENDERER, AlignTextRenderer))
53 #define ALIGN_TEXT_RENDERER_CLASS(klass) \
54 (G_TYPE_CHECK_CLASS_CAST((klass), \
55 TYPE_ALIGN_TEXT_RENDERER, \
56 AlignTextRendererClass))
57 #define IS_TEXT_ALIGN_RENDERER(obj) \
58 (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_TEXT_ALIGN_RENDERER))
59 #define IS_TEXT_ALIGN_RENDERER_CLASS(klass) \
60 (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_TEXT_ALIGN_RENDERER))
61 #define TEXT_ALIGN_RENDERER_GET_CLASS(obj) \
62 (G_TYPE_INSTANCE_GET_CLASS((obj), \
63 TYPE_ALIGN_TEXT_RENDERER, \
64 AlignTextRendererClass))
65
66 typedef struct _AlignTextRenderer AlignTextRenderer;
67 typedef struct _AlignTextRendererClass AlignTextRendererClass;
68
69 struct _AlignTextRenderer {
70 GtkCellRenderer parent;
71
72 gchar * text;
73 PangoTabArray * tab_array;
74 PangoGlyph align_center_glyph;
75 PangoGlyph align_right_glyph;
76 };
77
78 struct _AlignTextRendererClass {
79 GtkCellRendererClass parent_class;
80 void (* set_tab_array)(AlignTextRenderer * renderer,
81 PangoTabArray * tab_array);
82 };
83
84 GType cdebconf_gtk_align_text_renderer_get_type(void);
85 GtkCellRenderer * cdebconf_gtk_align_text_renderer_new(void);
86 void cdebconf_gtk_align_text_renderer_set_tab_array(
87 AlignTextRenderer * renderer, PangoTabArray * tab_array);
88
89 #endif /* ! _ALIGN_TEXT_RENDERER_H_ */
90
91 /* vim: et sw=4 si
92 */