Mercurial > pidgin
diff finch/libgnt/gntutils.h @ 20398:61d6a3dfbb3c
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4-rlaager-whitespace' (head 51cec0ffea45c8589dcb7bf0f9e36e749ed43017)
to branch 'im.pidgin.rlaager.merging.msnp13-and-pidgin' (head d0d075250a037e5d0a268a39501bf169465061a4)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 15 Apr 2007 03:56:08 +0000 |
parents | 2c81ebc7bf0b |
children | 5f204f55af09 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/finch/libgnt/gntutils.h Sun Apr 15 03:56:08 2007 +0000 @@ -0,0 +1,41 @@ +#include <glib.h> + +#include "gnt.h" +#include "gntwidget.h" + +typedef gpointer (*GDupFunc)(gconstpointer data); + +void gnt_util_get_text_bound(const char *text, int *width, int *height); + +/* excluding *end */ +int gnt_util_onscreen_width(const char *start, const char *end); + +const char *gnt_util_onscreen_width_to_pointer(const char *str, int len, int *w); + +/* Inserts newlines in 'string' where necessary so that its onscreen width is + * no more than 'maxw'. + * 'maxw' can be <= 0, in which case the maximum screen width is considered. + * + * Returns a newly allocated string. + */ +char *gnt_util_onscreen_fit_string(const char *string, int maxw); + +GHashTable *g_hash_table_duplicate(GHashTable *src, GHashFunc hash, + GEqualFunc equal, GDestroyNotify key_d, GDestroyNotify value_d, + GDupFunc key_dup, GDupFunc value_dup); + + +/** + * To be used with g_signal_new. Look in the key_pressed signal-definition in + * gntwidget.c for usage. + */ +gboolean gnt_boolean_handled_accumulator(GSignalInvocationHint *ihint, + GValue *return_accu, + const GValue *handler_return, + gpointer dummy); + +/** + * Returns a GntTree populated with "key" -> "binding" for the widget. + */ +GntWidget *gnt_widget_bindings_view(GntWidget *widget); +