annotate finch/libgnt/gntutils.h @ 26559:1c9bbfcc3687

merge of '009cd1791a028ae463fba5c8a2ee1c60021efb61' and '9420ff7a2d15050fcf1f87db358cca0e4e1d91bb'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 12 Apr 2009 21:11:00 +0000
parents ae330012956f
children 44f53d3fc54f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
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: 17928
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: 17928
diff changeset
3 * @ingroup gnt
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17928
diff changeset
4 */
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17928
diff changeset
5 /*
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
6 * GNT - The GLib Ncurses Toolkit
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
7 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
8 * GNT is the legal property of its developers, whose names are too numerous
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
10 * source distribution.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
11 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
12 * This library is free software; you can redistribute it and/or modify
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
13 * it under the terms of the GNU General Public License as published by
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
15 * (at your option) any later version.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
16 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
17 * This program is distributed in the hope that it will be useful,
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
20 * GNU General Public License for more details.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
21 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
22 * You should have received a copy of the GNU General Public License
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
23 * along with this program; if not, write to the Free Software
19681
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19334
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
25 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
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"
19334
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
30 #include "gnttextview.h"
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "gntwidget.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 typedef gpointer (*GDupFunc)(gconstpointer data);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
35 /**
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
36 * Compute the width and height required to view the text on the screen.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
37 *
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
38 * @param text The text to be displayed.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
39 * @param width The width required is set here, if not @c NULL.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
40 * @param height The height required is set here, if not @c NULL.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
41 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 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
43
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 /* excluding *end */
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
45 /**
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
46 * Get the onscreen width of a string, or a substring.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
47 *
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
48 * @param start The beginning of the string.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
49 * @param end The end of the string. The width returned is the width
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
50 * upto (but not including) end. If end is NULL, then start
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
51 * is considered as a @c NULL-terminated string.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
52 *
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
53 * @return The on-screen width of the string.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
54 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 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
56
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
57 /**
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
58 * Computes and returns the string after a specific number of onscreen characters.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
59 *
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
60 * @param str The string.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
61 * @param len The length to consider. If non-positive, the entire screenlength is used.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
62 * @param w The actual width of the string upto the returned offset, if not @c NULL.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
63 *
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
64 * @return The string after len offset.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
65 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 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
67
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
68 /**
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
69 * Inserts newlines in 'string' where necessary so that its onscreen width is
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 * no more than 'maxw'.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 *
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
72 * @param string The string.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
73 * @param maxw The width that the string should fit into. If maxw is <= 0,
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
74 * then the available maximum width is used.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
75 *
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
76 * @return A newly allocated string that needs to be freed by the caller.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
77 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
78 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
79
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
80 /**
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
81 * Duplicate the contents of a hastable.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
82 *
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
83 * @param src The source hashtable.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
84 * @param hash The hash-function to use.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
85 * @param equal The hash-equal function to use.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
86 * @param key_d The key-destroy function to use.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
87 * @param value_d The value-destroy function to use.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
88 * @param key_dup The function to use to duplicate the key.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
89 * @param value_dup The function to use to duplicate the value.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
90 *
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
91 * @return The new hashtable.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
92 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
93 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
94
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 /**
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 * 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
97 * gntwidget.c for usage.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
98 *
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
99 * @param ihint NA
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
100 * @param return_accu NA
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
101 * @param handler_return NA
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
102 * @param dummy NA
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
103 *
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
104 * @return NA
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
105 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
106 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
107
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 /**
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
109 * Get a helpful display about the bindings of a widget.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
110 *
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
111 * @param widget The widget to get bindings for.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
112 *
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
113 * @return Returns a GntTree populated with "key" -> "binding" for the widget.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
114 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
115 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
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 /**
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
118 * Parse widgets from an XML description. For example,
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
119 *
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
120 * @code
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
121 * GntWidget *win, *button;
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
122 * gnt_util_parse_widgets("\
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
123 * <vwindow id='0' fill='0' align='2'> \
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
124 * <label>This is a test</label> \
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
125 * <button id='1'>OK</button> \
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
126 * </vwindow>",
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
127 * 2, &win, &button);
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
128 * @endcode
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
129 *
18304
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
130 * @param string The XML string.
38ecbc8a70bd Start filling in the doxygen-help skeleton.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
131 * @param num The number of widgets to return, followed by 'num' GntWidget **
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16125
diff changeset
132 */
16125
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
133 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
134
18511
7ee0e0597a26 Add utility function to trigger some button when some key is pressed with
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18304
diff changeset
135 /**
19334
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
136 * Parse an XHTML string and add it in a GntTextView with
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
137 * appropriate text flags.
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
138 *
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
139 * @param string The XHTML string
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
140 * @param tv The GntTextView
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
141 * @return @c TRUE if the string was added to the textview properly, @c FALSE otherwise.
20874
acf284962b40 Add @since doxygen tags for finch/libgnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19681
diff changeset
142 *
acf284962b40 Add @since doxygen tags for finch/libgnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19681
diff changeset
143 * @since 2.2.0
19334
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
144 */
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
145 gboolean gnt_util_parse_xhtml_to_textview(const char *string, GntTextView *tv);
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
146
fda2d2d99850 Add support to parse and add XHTML in a textview. This we can use for logs,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19179
diff changeset
147 /**
18511
7ee0e0597a26 Add utility function to trigger some button when some key is pressed with
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18304
diff changeset
148 * Make some keypress activate a button when some key is pressed with 'wid' in focus.
7ee0e0597a26 Add utility function to trigger some button when some key is pressed with
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18304
diff changeset
149 *
7ee0e0597a26 Add utility function to trigger some button when some key is pressed with
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18304
diff changeset
150 * @param widget The widget
7ee0e0597a26 Add utility function to trigger some button when some key is pressed with
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18304
diff changeset
151 * @param key The key to trigger the button
7ee0e0597a26 Add utility function to trigger some button when some key is pressed with
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18304
diff changeset
152 * @param button The button to trigger
20874
acf284962b40 Add @since doxygen tags for finch/libgnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19681
diff changeset
153 *
acf284962b40 Add @since doxygen tags for finch/libgnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19681
diff changeset
154 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
18511
7ee0e0597a26 Add utility function to trigger some button when some key is pressed with
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18304
diff changeset
155 */
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
156 void gnt_util_set_trigger_widget(GntWidget *widget, const char *key, GntWidget *button);
18511
7ee0e0597a26 Add utility function to trigger some button when some key is pressed with
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18304
diff changeset
157