annotate finch/libgnt/gntutils.h @ 18049:1cedd520cd18

Doxygen skeleton and license info for gnt files.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 06 Jun 2007 15:42:29 +0000
parents 5f204f55af09
children 3ee6ea8a66f8 5c6f019e48f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
1 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
2 * GNT - The GLib Ncurses Toolkit
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
3 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
4 * GNT is the legal property of its developers, whose names are too numerous
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
6 * source distribution.
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
7 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
8 * This library is free software; you can redistribute it and/or modify
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
9 * it under the terms of the GNU General Public License as published by
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
11 * (at your option) any later version.
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
12 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
13 * This program is distributed in the hope that it will be useful,
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
16 * GNU General Public License for more details.
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
17 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
18 * You should have received a copy of the GNU General Public License
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
19 * along with this program; if not, write to the Free Software
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
21 */
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
22
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 #include <glib.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 #include "gnt.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 #include "gntwidget.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 typedef gpointer (*GDupFunc)(gconstpointer data);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
30 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
31 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
32 * @param text
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
33 * @param width
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
34 * @param height
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
35 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 void gnt_util_get_text_bound(const char *text, int *width, int *height);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 /* excluding *end */
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
39 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
40 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
41 * @param start
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
42 * @param end
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
43 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
44 * @return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
45 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 int gnt_util_onscreen_width(const char *start, const char *end);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 const char *gnt_util_onscreen_width_to_pointer(const char *str, int len, int *w);
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 /* Inserts newlines in 'string' where necessary so that its onscreen width is
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 * no more than 'maxw'.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 * 'maxw' can be <= 0, in which case the maximum screen width is considered.
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 * Returns a newly allocated string.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 */
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
56 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
57 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
58 * @param string
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
59 * @param maxw
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
60 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
61 * @return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
62 */
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
63 char * gnt_util_onscreen_fit_string(const char *string, int maxw);
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
65 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
66 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
67 * @param src
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
68 * @param hash
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
69 * @param equal
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
70 * @param key_d
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
71 * @param value_d
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
72 * @param key_dup
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
73 * @param value_dup
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
74 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
75 * @return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
76 */
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
77 GHashTable * g_hash_table_duplicate(GHashTable *src, GHashFunc hash, GEqualFunc equal, GDestroyNotify key_d, GDestroyNotify value_d, GDupFunc key_dup, GDupFunc value_dup);
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 /**
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 * To be used with g_signal_new. Look in the key_pressed signal-definition in
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 * gntwidget.c for usage.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82 */
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
83 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
84 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
85 * @param ihint
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
86 * @param return_accu
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
87 * @param handler_return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
88 * @param dummy
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
89 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
90 * @return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
91 */
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
92 gboolean gnt_boolean_handled_accumulator(GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy);
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93
15979
2c81ebc7bf0b Add a way to get a list of bindings for a widget. This can be used by, eg, a window-manager to show helpful messages to the user.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15817
diff changeset
94 /**
2c81ebc7bf0b Add a way to get a list of bindings for a widget. This can be used by, eg, a window-manager to show helpful messages to the user.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15817
diff changeset
95 * Returns a GntTree populated with "key" -> "binding" for the widget.
2c81ebc7bf0b Add a way to get a list of bindings for a widget. This can be used by, eg, a window-manager to show helpful messages to the user.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15817
diff changeset
96 */
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
97 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
98 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
99 * @param widget
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
100 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
101 * @return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
102 */
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
103 GntWidget * gnt_widget_bindings_view(GntWidget *widget);
15979
2c81ebc7bf0b Add a way to get a list of bindings for a widget. This can be used by, eg, a window-manager to show helpful messages to the user.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15817
diff changeset
104
16125
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
105 /**
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
106 * Parse widgets from 'string'.
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
107 */
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
108 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
109 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
110 * @param string
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
111 * @param num
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
112 */
16125
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
113 void gnt_util_parse_widgets(const char *string, int num, ...);
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
114