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