gntutils.h
Go to the documentation of this file.
1
5 /*
6 * GNT - The GLib Ncurses Toolkit
7 *
8 * GNT is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This library is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26
27 #include <glib.h>
28
29 #include "gnt.h"
30 #include "gnttextview.h"
31 #include "gntwidget.h"
32
33 typedef gpointer (*GDupFunc)(gconstpointer data);
34
42 void gnt_util_get_text_bound(const char *text, int *width, int *height);
43
44 /* excluding *end */
55 int gnt_util_onscreen_width(const char *start, const char *end);
56
66 const char *gnt_util_onscreen_width_to_pointer(const char *str, int len, int *w);
67
78 char * gnt_util_onscreen_fit_string(const char *string, int maxw);
79
93 GHashTable * g_hash_table_duplicate(GHashTable *src, GHashFunc hash, GEqualFunc equal, GDestroyNotify key_d, GDestroyNotify value_d, GDupFunc key_dup, GDupFunc value_dup);
94
106 gboolean gnt_boolean_handled_accumulator(GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy);
107
115 GntWidget * gnt_widget_bindings_view(GntWidget *widget);
116
133 void gnt_util_parse_widgets(const char *string, int num, ...);
134
145 gboolean gnt_util_parse_xhtml_to_textview(const char *string, GntTextView *tv);
146
156 void gnt_util_set_trigger_widget(GntWidget *widget, const char *key, GntWidget *button);
157
g_hash_table_duplicate
GHashTable * g_hash_table_duplicate(GHashTable *src, GHashFunc hash, GEqualFunc equal, GDestroyNotify key_d, GDestroyNotify value_d, GDupFunc key_dup, GDupFunc value_dup)
Duplicate the contents of a hastable.
_GntTextView
Definition: gnttextview.h:57
gnt_util_set_trigger_widget
void gnt_util_set_trigger_widget(GntWidget *widget, const char *key, GntWidget *button)
Make some keypress activate a button when some key is pressed with &#39;wid&#39; in focus.
gntwidget.h
Widget API.
gnt_util_onscreen_width_to_pointer
const char * gnt_util_onscreen_width_to_pointer(const char *str, int len, int *w)
Computes and returns the string after a specific number of onscreen characters.
gnt.h
GNT API.
gnt_boolean_handled_accumulator
gboolean gnt_boolean_handled_accumulator(GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy)
To be used with g_signal_new.
gnt_util_parse_widgets
void gnt_util_parse_widgets(const char *string, int num,...)
Parse widgets from an XML description.
gnt_util_get_text_bound
void gnt_util_get_text_bound(const char *text, int *width, int *height)
Compute the width and height required to view the text on the screen.
gnt_util_onscreen_width
int gnt_util_onscreen_width(const char *start, const char *end)
Get the onscreen width of a string, or a substring.
gnttextview.h
Textview API.
gnt_widget_bindings_view
GntWidget * gnt_widget_bindings_view(GntWidget *widget)
Get a helpful display about the bindings of a widget.
gnt_util_onscreen_fit_string
char * gnt_util_onscreen_fit_string(const char *string, int maxw)
Inserts newlines in &#39;string&#39; where necessary so that its onscreen width is no more than &#39;maxw&#39;...
gnt_util_parse_xhtml_to_textview
gboolean gnt_util_parse_xhtml_to_textview(const char *string, GntTextView *tv)
Parse an XHTML string and add it in a GntTextView with appropriate text flags.
_GntWidget
Definition: gntwidget.h:98