Mercurial > audlegacy
annotate src/audacious/util.h @ 4371:20418bdce637
Fixed a segfault when trying to open fileinfo window while no file is
effectively selected (e.g. when playlist is empty, for example). Patch
adapted from bugzilla #216 from Federico Schwindt.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 25 Mar 2008 21:16:16 +0200 |
parents | ac1f6d211223 |
children | 246244ead30e |
rev | line source |
---|---|
2313 | 1 /* Audacious - Cross-platform multimedia player |
4259
92642f860860
- added template for src_flow
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4215
diff
changeset
|
2 * Copyright (C) 2005-2008 Audacious development team |
2313 | 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 | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3103
diff
changeset
|
12 * the Free Software Foundation; under version 3 of the License. |
2313 | 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 | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3103
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3123
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
21 * |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
22 * The Audacious team does not consider modular code linking to |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
23 * Audacious or using our public API to be a derived work. |
2313 | 24 */ |
25 | |
26 #ifndef UTIL_H | |
27 #define UTIL_H | |
28 | |
2334
345d38f25eb1
[svn] - only evaluate -DHAVE_CONFIG_H if we're in audacious core. closes #760.
nenolod
parents:
2313
diff
changeset
|
29 #ifdef _AUDACIOUS_CORE |
345d38f25eb1
[svn] - only evaluate -DHAVE_CONFIG_H if we're in audacious core. closes #760.
nenolod
parents:
2313
diff
changeset
|
30 # ifdef HAVE_CONFIG_H |
2313 | 31 # include "config.h" |
2334
345d38f25eb1
[svn] - only evaluate -DHAVE_CONFIG_H if we're in audacious core. closes #760.
nenolod
parents:
2313
diff
changeset
|
32 # endif |
2313 | 33 #endif |
34 | |
35 #include <glib.h> | |
36 #include <gtk/gtk.h> | |
37 | |
38 G_BEGIN_DECLS | |
39 | |
3747 | 40 #include "audacious/plugin.h" |
4259
92642f860860
- added template for src_flow
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4215
diff
changeset
|
41 #include "libSAD/libSAD.h" |
2313 | 42 |
3747 | 43 #define SWAP(a, b) { a^=b; b^=a; a^=b; } |
2529 | 44 |
2313 | 45 typedef gboolean(*DirForeachFunc) (const gchar * path, |
46 const gchar * basename, | |
47 gpointer user_data); | |
48 | |
49 | |
50 gchar *find_file_recursively(const gchar * dirname, const gchar * file); | |
2989
15f6c9949cde
Add and use find_path_recursively() which search the FS without using VFS (for GTK).
William Pitcock <nenolod@atheme-project.org>
parents:
2977
diff
changeset
|
51 gchar *find_path_recursively(const gchar * dirname, const gchar * file); |
2313 | 52 void del_directory(const gchar * dirname); |
53 gboolean dir_foreach(const gchar * path, DirForeachFunc function, | |
54 gpointer user_data, GError ** error); | |
55 | |
2529 | 56 |
57 INIFile *open_ini_file(const gchar *filename); | |
58 void close_ini_file(INIFile *key_file); | |
59 gchar *read_ini_string(INIFile *key_file, const gchar *section, | |
60 const gchar *key); | |
61 GArray *read_ini_array(INIFile *key_file, const gchar *section, | |
62 const gchar *key); | |
2313 | 63 |
64 GArray *string_to_garray(const gchar * str); | |
65 | |
66 void glist_movedown(GList * list); | |
67 void glist_moveup(GList * list); | |
68 | |
69 void util_menu_position(GtkMenu * menu, gint * x, gint * y, | |
70 gboolean * push_in, gpointer data); | |
71 | |
72 GdkFont *util_font_load(const gchar * name); | |
73 void util_set_cursor(GtkWidget * window); | |
74 gboolean text_get_extents(const gchar * fontname, const gchar * text, | |
75 gint * width, gint * height, gint * ascent, | |
76 gint * descent); | |
77 | |
78 gboolean file_is_archive(const gchar * filename); | |
79 gchar *archive_decompress(const gchar * path); | |
80 gchar *archive_basename(const gchar * path); | |
81 | |
82 guint gint_count_digits(gint n); | |
83 | |
84 | |
2514
7934ac463591
[svn] - removed unused function bmp_menu_translate()
mf0102
parents:
2442
diff
changeset
|
85 GtkWidget *make_filebrowser(const gchar *title, gboolean save); |
2313 | 86 |
87 typedef struct { | |
88 gint x; | |
89 gint y; | |
90 } MenuPos; | |
91 | |
3731
0e5da33a32b7
fun util dialog shit -> vtable
William Pitcock <nenolod@atheme.org>
parents:
3730
diff
changeset
|
92 GtkWidget *util_info_dialog(const gchar * title, const gchar * text, |
0e5da33a32b7
fun util dialog shit -> vtable
William Pitcock <nenolod@atheme.org>
parents:
3730
diff
changeset
|
93 const gchar * button_text, gboolean modal, |
0e5da33a32b7
fun util dialog shit -> vtable
William Pitcock <nenolod@atheme.org>
parents:
3730
diff
changeset
|
94 GCallback button_action, |
0e5da33a32b7
fun util dialog shit -> vtable
William Pitcock <nenolod@atheme.org>
parents:
3730
diff
changeset
|
95 gpointer action_data); |
2313 | 96 |
4212
47352b34dbdf
introduce ui_skinned_widget_draw
Tomasz Mon <desowin@gmail.com>
parents:
4070
diff
changeset
|
97 void ui_skinned_widget_draw(GtkWidget *widget, GdkPixbuf *obj, gint width, gint height, gboolean scale); |
2313 | 98 |
99 GdkPixbuf *audacious_create_colorized_pixbuf(GdkPixbuf *src, gint red, gint green, gint blue); | |
100 | |
3757
d24d28e76588
export util_get_localdir().
William Pitcock <nenolod@atheme.org>
parents:
3747
diff
changeset
|
101 gchar *util_get_localdir(void); |
2340
eb71fec30e9a
[svn] - added audacious_get_localdir() in util.c/h, returns a string with the full path of audacious local datadir
giacomo
parents:
2334
diff
changeset
|
102 |
3306
404ffedef3e1
added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents:
3123
diff
changeset
|
103 /* menu-related function */ |
3765
b4a9d4be27ab
forgot to export a symbol. now I am done. really.
William Pitcock <nenolod@atheme.org>
parents:
3757
diff
changeset
|
104 void util_menu_main_show(gint x, gint y, guint button, guint time); |
2353
0fb258122933
[svn] - added audacious_menu_main_show(x,y,button,time) in util.h, convenience function to display the audacious main popup menu
giacomo
parents:
2340
diff
changeset
|
105 |
4070
040243a50bd3
- modified playlist_load_ins_file() and playlist_load_ins_file_tuple(). path builder and ext_hash checker
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3765
diff
changeset
|
106 gchar *construct_uri(gchar *string, const gchar *playlist_name); |
3306
404ffedef3e1
added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents:
3123
diff
changeset
|
107 |
4259
92642f860860
- added template for src_flow
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4215
diff
changeset
|
108 SAD_sample_format sadfmt_from_afmt(AFormat fmt); |
92642f860860
- added template for src_flow
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4215
diff
changeset
|
109 |
4267
a41fb6bc632a
- src stuff traveled to src_flow.c
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4259
diff
changeset
|
110 /* minimizes number of realloc's */ |
4278 | 111 gpointer smart_realloc(gpointer ptr, gsize *size); |
4267
a41fb6bc632a
- src stuff traveled to src_flow.c
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4259
diff
changeset
|
112 |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
4278
diff
changeset
|
113 void make_directory(const gchar * path, mode_t mode); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
4278
diff
changeset
|
114 |
2313 | 115 G_END_DECLS |
116 | |
117 #endif |