Mercurial > audlegacy
annotate src/audacious/util.h @ 2334:345d38f25eb1 trunk
[svn] - only evaluate -DHAVE_CONFIG_H if we're in audacious core. closes #760.
author | nenolod |
---|---|
date | Mon, 15 Jan 2007 08:08:40 -0800 |
parents | 3149d4b1a9a9 |
children | eb71fec30e9a |
rev | line source |
---|---|
2313 | 1 /* Audacious - Cross-platform multimedia player |
2 * Copyright (C) 2005-2007 Audacious development team | |
3 * | |
4 * Based on BMP: | |
5 * Copyright (C) 2003-2004 BMP development team | |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2003 XMMS development team | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; under version 2 of the License. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
22 */ | |
23 | |
24 #ifndef UTIL_H | |
25 #define UTIL_H | |
26 | |
2334
345d38f25eb1
[svn] - only evaluate -DHAVE_CONFIG_H if we're in audacious core. closes #760.
nenolod
parents:
2313
diff
changeset
|
27 #ifdef _AUDACIOUS_CORE |
345d38f25eb1
[svn] - only evaluate -DHAVE_CONFIG_H if we're in audacious core. closes #760.
nenolod
parents:
2313
diff
changeset
|
28 # ifdef HAVE_CONFIG_H |
2313 | 29 # include "config.h" |
2334
345d38f25eb1
[svn] - only evaluate -DHAVE_CONFIG_H if we're in audacious core. closes #760.
nenolod
parents:
2313
diff
changeset
|
30 # endif |
2313 | 31 #endif |
32 | |
33 #include <glib.h> | |
34 #include <gtk/gtk.h> | |
35 | |
36 G_BEGIN_DECLS | |
37 | |
38 #define NO_PLAY_BUTTON FALSE | |
39 #define PLAY_BUTTON TRUE | |
40 | |
41 #define SWAP(a, b) { a^=b; b^=a; a^=b; } | |
42 | |
43 | |
44 typedef gboolean(*DirForeachFunc) (const gchar * path, | |
45 const gchar * basename, | |
46 gpointer user_data); | |
47 | |
48 | |
49 gchar *escape_shell_chars(const gchar * string); | |
50 | |
51 gchar *find_file_recursively(const gchar * dirname, const gchar * file); | |
52 void del_directory(const gchar * dirname); | |
53 gboolean dir_foreach(const gchar * path, DirForeachFunc function, | |
54 gpointer user_data, GError ** error); | |
55 | |
56 gchar *read_ini_string(const gchar * filename, const gchar * section, | |
57 const gchar * key); | |
58 GArray *read_ini_array(const gchar * filename, const gchar * section, | |
59 const gchar * key); | |
60 | |
61 GArray *string_to_garray(const gchar * str); | |
62 | |
63 void glist_movedown(GList * list); | |
64 void glist_moveup(GList * list); | |
65 | |
66 GtkWidget *util_add_url_dialog_new(const gchar * caption, GCallback ok_func, | |
67 GCallback enqueue_func); | |
68 void util_menu_position(GtkMenu * menu, gint * x, gint * y, | |
69 gboolean * push_in, gpointer data); | |
70 | |
71 void util_run_filebrowser(gboolean clear_pl_on_ok); | |
72 gboolean util_filechooser_is_dir(GtkFileChooser * filesel); | |
73 | |
74 GdkFont *util_font_load(const gchar * name); | |
75 void util_set_cursor(GtkWidget * window); | |
76 gboolean text_get_extents(const gchar * fontname, const gchar * text, | |
77 gint * width, gint * height, gint * ascent, | |
78 gint * descent); | |
79 | |
80 gboolean file_is_archive(const gchar * filename); | |
81 gchar *archive_decompress(const gchar * path); | |
82 gchar *archive_basename(const gchar * path); | |
83 | |
84 guint gint_count_digits(gint n); | |
85 | |
86 gchar *convert_title_text(gchar * text); | |
87 | |
88 gchar *str_append(gchar * str, const gchar * add_str); | |
89 gchar *str_replace(gchar * str, gchar * new_str); | |
90 void str_replace_in(gchar ** str, gchar * new_str); | |
91 | |
92 gboolean str_has_prefix_nocase(const gchar * str, const gchar * prefix); | |
93 gboolean str_has_suffix_nocase(const gchar * str, const gchar * suffix); | |
94 gboolean str_has_suffixes_nocase(const gchar * str, gchar * const *suffixes); | |
95 const gchar *str_skip_chars(const gchar * str, const gchar * chars); | |
96 | |
97 gchar *filename_to_utf8(const gchar * filename); | |
98 gchar *str_to_utf8(const gchar * str); | |
99 gchar *str_to_utf8_fallback(const gchar * str); | |
100 | |
101 #if ENABLE_NLS | |
102 gchar *bmp_menu_translate(const gchar * path, gpointer func_data); | |
103 #else | |
104 # define bmp_menu_translate NULL | |
105 #endif | |
106 | |
107 GtkWidget *make_filebrowser(const gchar * title, | |
108 gboolean save); | |
109 | |
110 typedef struct { | |
111 gint x; | |
112 gint y; | |
113 } MenuPos; | |
114 | |
115 gchar *chardet_to_utf8(const gchar *str, gssize len, | |
116 gsize *arg_bytes_read, gsize *arg_bytes_write, GError **arg_error); | |
117 | |
118 GdkPixmap *audacious_pixmap_resize(GdkWindow *src, GdkGC *src_gc, GdkPixmap *in, gint width, gint height); | |
119 | |
120 /* XMMS names */ | |
121 | |
122 #define bmp_info_dialog(title, text, button_text, model, button_action, action_data) \ | |
123 xmms_show_message(title, text, button_text, model, button_action, action_data) | |
124 | |
125 #define bmp_usleep(usec) \ | |
126 xmms_usleep(usec) | |
127 | |
128 #define bmp_check_realtime_priority() \ | |
129 xmms_check_realtime_priority() | |
130 | |
131 GtkWidget *xmms_show_message(const gchar * title, const gchar * text, | |
132 const gchar * button_text, gboolean modal, | |
133 GtkSignalFunc button_action, | |
134 gpointer action_data); | |
135 gboolean xmms_check_realtime_priority(void); | |
136 void xmms_usleep(gint usec); | |
137 | |
138 GdkImage *create_dblsize_image(GdkImage * img); | |
139 | |
140 gchar *xmms_urldecode_path(const gchar * encoded_path); | |
141 | |
142 GdkPixbuf *audacious_create_colorized_pixbuf(GdkPixbuf *src, gint red, gint green, gint blue); | |
143 | |
144 G_END_DECLS | |
145 | |
146 #endif |