annotate finch/libgnt/gntutils.h @ 17992:5e34cd288a98

merge of 'bdd3cb040100fe925456b862d03cc6c5a61648ef' and 'd4717c30b427fc205d5e8026f0d4305f7cd53f5c'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 02 Jun 2007 06:43:53 +0000
parents 5f204f55af09
children 8410511f4dbb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 #include <glib.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 #include "gnt.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4 #include "gntwidget.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 typedef gpointer (*GDupFunc)(gconstpointer data);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 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
9
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 /* excluding *end */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 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
12
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 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
14
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 /* 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
16 * no more than 'maxw'.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * '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
18 *
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * Returns a newly allocated string.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 char *gnt_util_onscreen_fit_string(const char *string, int maxw);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 GHashTable *g_hash_table_duplicate(GHashTable *src, GHashFunc hash,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24 GEqualFunc equal, GDestroyNotify key_d, GDestroyNotify value_d,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 GDupFunc key_dup, GDupFunc value_dup);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26
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 /**
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 * 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
30 * gntwidget.c for usage.
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 gboolean gnt_boolean_handled_accumulator(GSignalInvocationHint *ihint,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 GValue *return_accu,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 const GValue *handler_return,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 gpointer dummy);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36
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
37 /**
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
38 * 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
39 */
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
40 GntWidget *gnt_widget_bindings_view(GntWidget *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
41
16125
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
42 /**
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
43 * 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
44 */
5f204f55af09 Add a utility function to create widgets from an XML description.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15979
diff changeset
45 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
46