Mercurial > audlegacy
annotate audacious/util.h @ 2184:7d40f0a290b9 trunk
[svn] - break out string-related functions from util.c
author | nenolod |
---|---|
date | Wed, 20 Dec 2006 06:45:56 -0800 |
parents | f18a5b617c34 |
children | c108a98794b1 |
rev | line source |
---|---|
0 | 1 /* BMP - Cross-platform multimedia player |
2 * Copyright (C) 2003-2004 BMP development team. | |
3 * | |
4 * Based on XMMS: | |
5 * Copyright (C) 1998-2003 XMMS development team. | |
6 * | |
7 * This program is free software; you can redistribute it and/or modify | |
8 * it under the terms of the GNU General Public License as published by | |
2105
f18a5b617c34
[svn] - move to GPLv2-only. Based on my interpretation of the license, we are
nenolod
parents:
2074
diff
changeset
|
9 * the Free Software Foundation; under version 2 of the License. |
0 | 10 * |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
1459 | 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
0 | 19 */ |
20 | |
21 #ifndef UTIL_H | |
22 #define UTIL_H | |
23 | |
24 #ifdef HAVE_CONFIG_H | |
25 # include "config.h" | |
26 #endif | |
27 | |
28 #include <glib.h> | |
29 #include <gtk/gtk.h> | |
30 | |
1737 | 31 G_BEGIN_DECLS |
0 | 32 |
33 #define NO_PLAY_BUTTON FALSE | |
34 #define PLAY_BUTTON TRUE | |
35 | |
36 #define SWAP(a, b) { a^=b; b^=a; a^=b; } | |
37 | |
38 | |
39 typedef gboolean(*DirForeachFunc) (const gchar * path, | |
40 const gchar * basename, | |
41 gpointer user_data); | |
42 | |
43 | |
44 gchar *escape_shell_chars(const gchar * string); | |
45 | |
46 gchar *find_file_recursively(const gchar * dirname, const gchar * file); | |
47 void del_directory(const gchar * dirname); | |
48 gboolean dir_foreach(const gchar * path, DirForeachFunc function, | |
49 gpointer user_data, GError ** error); | |
50 | |
51 gchar *read_ini_string(const gchar * filename, const gchar * section, | |
52 const gchar * key); | |
53 GArray *read_ini_array(const gchar * filename, const gchar * section, | |
54 const gchar * key); | |
55 | |
56 GArray *string_to_garray(const gchar * str); | |
57 | |
58 void glist_movedown(GList * list); | |
59 void glist_moveup(GList * list); | |
60 | |
61 void util_item_factory_popup(GtkItemFactory * ifactory, guint x, guint y, | |
62 guint mouse_button, guint32 time); | |
63 void util_item_factory_popup_with_data(GtkItemFactory * ifactory, | |
64 gpointer data, | |
65 GtkDestroyNotify destroy, guint x, | |
66 guint y, guint mouse_button, | |
67 guint32 time); | |
86 | 68 GtkWidget *util_add_url_dialog_new(const gchar * caption, GCallback ok_func, |
0 | 69 GCallback enqueue_func); |
70 void util_menu_position(GtkMenu * menu, gint * x, gint * y, | |
71 gboolean * push_in, gpointer data); | |
72 | |
73 void util_run_filebrowser(gboolean clear_pl_on_ok); | |
74 gboolean util_filechooser_is_dir(GtkFileChooser * filesel); | |
75 | |
76 GdkFont *util_font_load(const gchar * name); | |
77 void util_set_cursor(GtkWidget * window); | |
78 gboolean text_get_extents(const gchar * fontname, const gchar * text, | |
79 gint * width, gint * height, gint * ascent, | |
80 gint * descent); | |
81 | |
82 gboolean file_is_archive(const gchar * filename); | |
83 gchar *archive_decompress(const gchar * path); | |
84 gchar *archive_basename(const gchar * path); | |
85 | |
86 guint gint_count_digits(gint n); | |
87 | |
88 gchar *convert_title_text(gchar * text); | |
89 | |
90 gchar *str_append(gchar * str, const gchar * add_str); | |
91 gchar *str_replace(gchar * str, gchar * new_str); | |
92 void str_replace_in(gchar ** str, gchar * new_str); | |
93 | |
94 gboolean str_has_prefix_nocase(const gchar * str, const gchar * prefix); | |
95 gboolean str_has_suffix_nocase(const gchar * str, const gchar * suffix); | |
96 gboolean str_has_suffixes_nocase(const gchar * str, gchar * const *suffixes); | |
97 const gchar *str_skip_chars(const gchar * str, const gchar * chars); | |
98 | |
99 gchar *filename_to_utf8(const gchar * filename); | |
100 gchar *str_to_utf8(const gchar * str); | |
101 gchar *str_to_utf8_fallback(const gchar * str); | |
102 | |
103 #if ENABLE_NLS | |
104 gchar *bmp_menu_translate(const gchar * path, gpointer func_data); | |
105 #else | |
106 # define bmp_menu_translate NULL | |
107 #endif | |
108 | |
109 GtkItemFactory *create_menu(GtkItemFactoryEntry *entries, | |
110 guint n_entries, | |
111 GtkAccelGroup *accel); | |
112 | |
113 void make_submenu(GtkItemFactory *menu, | |
114 const gchar *item_path, | |
115 GtkItemFactory *submenu); | |
116 | |
1653 | 117 GtkWidget *make_filebrowser(const gchar * title, |
0 | 118 gboolean save); |
119 | |
120 typedef struct { | |
121 gint x; | |
122 gint y; | |
123 } MenuPos; | |
124 | |
1105
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
86
diff
changeset
|
125 gchar *chardet_to_utf8(const gchar *str, gssize len, |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
86
diff
changeset
|
126 gsize *arg_bytes_read, gsize *arg_bytes_write, GError **arg_error); |
0 | 127 |
1851
aceb472cce6c
[svn] - add audacious_pixmap_resize() for resizing a skin pixmap on demand.
nenolod
parents:
1750
diff
changeset
|
128 GdkPixmap *audacious_pixmap_resize(GdkWindow *src, GdkGC *src_gc, GdkPixmap *in, gint width, gint height); |
aceb472cce6c
[svn] - add audacious_pixmap_resize() for resizing a skin pixmap on demand.
nenolod
parents:
1750
diff
changeset
|
129 |
1734
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
130 /* XMMS names */ |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
131 |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
132 #define bmp_info_dialog(title, text, button_text, model, button_action, action_data) \ |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
133 xmms_show_message(title, text, button_text, model, button_action, action_data) |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
134 |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
135 #define bmp_usleep(usec) \ |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
136 xmms_usleep(usec) |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
137 |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
138 #define bmp_check_realtime_priority() \ |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
139 xmms_check_realtime_priority() |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
140 |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
141 GtkWidget *xmms_show_message(const gchar * title, const gchar * text, |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
142 const gchar * button_text, gboolean modal, |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
143 GtkSignalFunc button_action, |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
144 gpointer action_data); |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
145 gboolean xmms_check_realtime_priority(void); |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
146 void xmms_usleep(gint usec); |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
147 |
1938 | 148 GdkImage *create_dblsize_image(GdkImage * img); |
149 | |
2074
c725daec3849
[svn] - move xmms_urldecode_path() back into main binary
nenolod
parents:
1938
diff
changeset
|
150 gchar *xmms_urldecode_path(const gchar * encoded_path); |
c725daec3849
[svn] - move xmms_urldecode_path() back into main binary
nenolod
parents:
1938
diff
changeset
|
151 |
c725daec3849
[svn] - move xmms_urldecode_path() back into main binary
nenolod
parents:
1938
diff
changeset
|
152 |
1734
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
153 G_END_DECLS |
43c197f55dda
[svn] - merge libaudacious (public) and audacious util APIs
nenolod
parents:
1653
diff
changeset
|
154 |
0 | 155 #endif |