annotate finch/libgnt/gntline.c @ 32805:064eb5d78946

propagate from branch 'im.pidgin.pidgin.2.x.y' (head 0ba3afb8adb303a77581a7872d674c600979a5a6) to branch 'im.pidgin.pidgin' (head 7711a4d267e1fe776387496c764fb63227d70aec)
author Mark Doliner <mark@kingant.net>
date Mon, 31 Oct 2011 01:25:36 +0000
parents 88d889b54df4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
1 /**
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
2 * GNT - The GLib Ncurses Toolkit
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
3 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
4 * GNT is the legal property of its developers, whose names are too numerous
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
6 * source distribution.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
7 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
8 * This library is free software; you can redistribute it and/or modify
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
9 * it under the terms of the GNU General Public License as published by
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
11 * (at your option) any later version.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
12 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
13 * This program is distributed in the hope that it will be useful,
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
16 * GNU General Public License for more details.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
17 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
18 * You should have received a copy of the GNU General Public License
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
19 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18869
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
21 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
22
29220
88d889b54df4 Fix building finch & libgnt using older gcc or non-gcc compilers that do
Stu Tomlinson <stu@nosnilmot.com>
parents: 21250
diff changeset
23 #include "gntinternal.h"
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24 #include "gntline.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 enum
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 {
18869
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
28 PROP_0,
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
29 PROP_VERTICAL
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
30 };
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
31
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
32 enum
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
33 {
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 SIGS = 1,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 static GntWidgetClass *parent_class = NULL;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 static void
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 gnt_line_draw(GntWidget *widget)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 GntLine *line = GNT_LINE(widget);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 if (line->vertical)
21250
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
44 mvwvline(widget->window, 1, 0, ACS_VLINE | gnt_color_pair(GNT_COLOR_NORMAL),
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 widget->priv.height - 2);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 else
21250
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
47 mvwhline(widget->window, 0, 1, ACS_HLINE | gnt_color_pair(GNT_COLOR_NORMAL),
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 widget->priv.width - 2);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 static void
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 gnt_line_size_request(GntWidget *widget)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 if (GNT_LINE(widget)->vertical)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 widget->priv.width = 1;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 widget->priv.height = 5;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 else
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 widget->priv.width = 5;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 widget->priv.height = 1;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 static void
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 gnt_line_map(GntWidget *widget)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69 if (widget->priv.width == 0 || widget->priv.height == 0)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 gnt_widget_size_request(widget);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 GNTDEBUG;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 static void
18869
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
75 gnt_line_set_property(GObject *obj, guint prop_id, const GValue *value,
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
76 GParamSpec *spec)
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
77 {
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
78 GntLine *line = GNT_LINE(obj);
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
79 switch (prop_id) {
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
80 case PROP_VERTICAL:
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
81 line->vertical = g_value_get_boolean(value);
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
82 if (line->vertical) {
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
83 GNT_WIDGET_SET_FLAGS(line, GNT_WIDGET_GROW_Y);
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
84 } else {
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
85 GNT_WIDGET_SET_FLAGS(line, GNT_WIDGET_GROW_X);
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
86 }
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
87 break;
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
88 default:
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
89 break;
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
90 }
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
91 }
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
92
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
93 static void
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
94 gnt_line_get_property(GObject *obj, guint prop_id, GValue *value,
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
95 GParamSpec *spec)
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
96 {
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
97 GntLine *line = GNT_LINE(obj);
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
98 switch (prop_id) {
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
99 case PROP_VERTICAL:
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
100 g_value_set_boolean(value, line->vertical);
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
101 break;
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
102 default:
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
103 break;
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
104 }
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
105 }
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
106
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
107 static void
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108 gnt_line_class_init(GntLineClass *klass)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109 {
18869
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
110 GObjectClass *gclass = G_OBJECT_CLASS(klass);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111 parent_class = GNT_WIDGET_CLASS(klass);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 parent_class->draw = gnt_line_draw;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113 parent_class->map = gnt_line_map;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
114 parent_class->size_request = gnt_line_size_request;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
115
18869
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
116 gclass->set_property = gnt_line_set_property;
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
117 gclass->get_property = gnt_line_get_property;
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
118 g_object_class_install_property(gclass,
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
119 PROP_VERTICAL,
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
120 g_param_spec_boolean("vertical", "Vertical",
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
121 "Whether it's a vertical line or a horizontal one.",
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
122 TRUE,
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
123 G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
124 )
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
125 );
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
128 static void
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129 gnt_line_init(GTypeInstance *instance, gpointer class)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 GntWidget *widget = GNT_WIDGET(instance);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132 GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_SHADOW | GNT_WIDGET_NO_BORDER);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133 widget->priv.minw = 1;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134 widget->priv.minh = 1;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135 GNTDEBUG;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138 /******************************************************************************
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 * GntLine API
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140 *****************************************************************************/
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 GType
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142 gnt_line_get_gtype(void)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144 static GType type = 0;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 if(type == 0)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148 static const GTypeInfo info = {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 sizeof(GntLineClass),
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 NULL, /* base_init */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 NULL, /* base_finalize */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 (GClassInitFunc)gnt_line_class_init,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 NULL, /* class_finalize */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 NULL, /* class_data */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155 sizeof(GntLine),
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 0, /* n_preallocs */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 gnt_line_init, /* instance_init */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158 NULL /* value_table */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161 type = g_type_register_static(GNT_TYPE_WIDGET,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162 "GntLine",
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 &info, 0);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
166 return type;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 GntWidget *gnt_line_new(gboolean vertical)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 {
18869
5dc587a877d6 Use gobject properties for lines.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
171 GntWidget *widget = g_object_new(GNT_TYPE_LINE, "vertical", vertical, NULL);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 return widget;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174