annotate finch/libgnt/gntutils.h @ 18303:5c6f019e48f8

Generate doxy-help files for libgnt. And make it actually work.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 27 Jun 2007 04:15:36 +0000
parents 1cedd520cd18
children 38ecbc8a70bd
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 /**
18303
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18049
diff changeset
2 * @file gntutils.h Some utility functions
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18049
diff changeset
3 * @ingroup gnt
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18049
diff changeset
4 */
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18049
diff changeset
5 /*
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
6 * GNT - The GLib Ncurses Toolkit
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 * 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
9 * 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
10 * source distribution.
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
11 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
12 * 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
13 * 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
14 * 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
15 * (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
16 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
17 * 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
18 * 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
19 * 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
20 * 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
21 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
22 * 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
23 * 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
24 * 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
25 */
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
26
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #include <glib.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include "gnt.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "gntwidget.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 typedef gpointer (*GDupFunc)(gconstpointer data);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
34 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
35 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
36 * @param text
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
37 * @param width
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
38 * @param height
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
39 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 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
41
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 /* excluding *end */
18049
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 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
45 * @param start
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
46 * @param end
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
47 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
48 * @return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
49 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 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
51
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 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
53
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 /* 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
55 * no more than 'maxw'.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 * '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
57 *
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 * Returns a newly allocated string.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 */
18049
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 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
62 * @param string
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
63 * @param maxw
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
64 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
65 * @return
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 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
68
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
69 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
70 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
71 * @param src
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
72 * @param hash
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
73 * @param equal
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
74 * @param key_d
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
75 * @param value_d
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
76 * @param key_dup
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
77 * @param value_dup
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
78 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
79 * @return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
80 */
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
81 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
82
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 /**
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84 * 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
85 * gntwidget.c for usage.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 */
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
87 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
88 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
89 * @param ihint
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
90 * @param return_accu
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
91 * @param handler_return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
92 * @param dummy
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
93 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
94 * @return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
95 */
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
96 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
97
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
98 /**
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
99 * 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
100 */
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
101 /**
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 * @param widget
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
104 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
105 * @return
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
106 */
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
107 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
108
16125
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
109 /**
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
110 * 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
111 */
18049
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
112 /**
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
113 *
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
114 * @param string
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
115 * @param num
1cedd520cd18 Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16125
diff changeset
116 */
16125
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
117 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
118