Mercurial > audlegacy
annotate libaudacious/util.c @ 2129:0d845907c0b9 trunk
[svn] added a regex-based search option in playlist that allows to select playlist entries using multiple match criteria
author | giacomo |
---|---|
date | Fri, 15 Dec 2006 11:14:46 -0800 |
parents | f18a5b617c34 |
children |
rev | line source |
---|---|
2053 | 1 /* Audacious |
2 * Copyright (C) 2005-2007 Audacious team | |
3 * | |
4 * XMMS - Cross-platform multimedia player | |
5 * Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas, | |
6 * Thomas Nilsson and 4Front Technologies | |
7 * Copyright (C) 1999-2003 Haavard Kvaalen | |
8 * | |
9 * This program is free software; you can redistribute it and/or modify | |
10 * 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:
2053
diff
changeset
|
11 * the Free Software Foundation; under version 2 of the License. |
2053 | 12 * |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
21 */ | |
22 | |
0 | 23 #ifdef HAVE_CONFIG_H |
24 # include "config.h" | |
25 #endif | |
26 | |
27 #include <glib.h> | |
28 #include <gtk/gtk.h> | |
29 | |
2053 | 30 /** |
31 * xmms_show_message: | |
32 * @title: The title of the message to show. | |
33 * @text: The text of the message to show. | |
34 * @button_text: The text of the button which will close the messagebox. | |
35 * @modal: Whether or not the messagebox should be modal. | |
36 * @button_action: Code to execute on when the messagebox is closed, or %NULL. | |
37 * @action_data: Optional opaque data to pass to @button_action. | |
38 * | |
39 * Displays a message box. | |
40 * | |
41 * Return value: A GTK widget handle for the message box. | |
42 **/ | |
0 | 43 GtkWidget * |
44 xmms_show_message(const gchar * title, const gchar * text, | |
45 const gchar * button_text, gboolean modal, | |
46 GtkSignalFunc button_action, gpointer action_data) | |
47 { | |
863 | 48 GtkWidget *dialog; |
49 GtkWidget *dialog_vbox, *dialog_hbox, *dialog_bbox; | |
50 GtkWidget *dialog_bbox_b1; | |
51 GtkWidget *dialog_textlabel; | |
52 GtkWidget *dialog_icon; | |
0 | 53 |
863 | 54 dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
55 gtk_window_set_type_hint( GTK_WINDOW(dialog) , GDK_WINDOW_TYPE_HINT_DIALOG ); | |
56 gtk_window_set_modal( GTK_WINDOW(dialog) , modal ); | |
57 gtk_window_set_title( GTK_WINDOW(dialog) , title ); | |
58 gtk_container_set_border_width( GTK_CONTAINER(dialog) , 10 ); | |
0 | 59 |
863 | 60 dialog_vbox = gtk_vbox_new( FALSE , 0 ); |
61 dialog_hbox = gtk_hbox_new( FALSE , 0 ); | |
0 | 62 |
863 | 63 /* icon */ |
64 dialog_icon = gtk_image_new_from_stock( GTK_STOCK_DIALOG_INFO , GTK_ICON_SIZE_DIALOG ); | |
65 gtk_box_pack_start( GTK_BOX(dialog_hbox) , dialog_icon , FALSE , FALSE , 2 ); | |
0 | 66 |
863 | 67 /* label */ |
68 dialog_textlabel = gtk_label_new( text ); | |
69 /* gtk_label_set_selectable( GTK_LABEL(dialog_textlabel) , TRUE ); */ | |
70 gtk_box_pack_start( GTK_BOX(dialog_hbox) , dialog_textlabel , TRUE , TRUE , 2 ); | |
0 | 71 |
863 | 72 gtk_box_pack_start( GTK_BOX(dialog_vbox) , dialog_hbox , FALSE , FALSE , 2 ); |
73 gtk_box_pack_start( GTK_BOX(dialog_vbox) , gtk_hseparator_new() , FALSE , FALSE , 4 ); | |
0 | 74 |
863 | 75 dialog_bbox = gtk_hbutton_box_new(); |
76 gtk_button_box_set_layout( GTK_BUTTON_BOX(dialog_bbox) , GTK_BUTTONBOX_END ); | |
77 dialog_bbox_b1 = gtk_button_new_with_label( button_text ); | |
78 g_signal_connect_swapped( G_OBJECT(dialog_bbox_b1) , "clicked" , | |
79 G_CALLBACK(gtk_widget_destroy) , dialog ); | |
80 if ( button_action ) | |
81 g_signal_connect( G_OBJECT(dialog_bbox_b1) , "clicked" , | |
82 button_action , action_data ); | |
83 GTK_WIDGET_SET_FLAGS( dialog_bbox_b1 , GTK_CAN_DEFAULT); | |
84 gtk_widget_grab_default( dialog_bbox_b1 ); | |
0 | 85 |
863 | 86 gtk_container_add( GTK_CONTAINER(dialog_bbox) , dialog_bbox_b1 ); |
87 gtk_box_pack_start( GTK_BOX(dialog_vbox) , dialog_bbox , FALSE , FALSE , 0 ); | |
0 | 88 |
863 | 89 gtk_container_add( GTK_CONTAINER(dialog) , dialog_vbox ); |
90 gtk_widget_show_all(dialog); | |
0 | 91 |
863 | 92 return dialog; |
0 | 93 } |
94 | |
2053 | 95 /** |
96 * xmms_check_realtime_priority: | |
97 * | |
98 * Legacy function included for compatibility with XMMS. | |
99 * | |
100 * Return value: FALSE | |
101 **/ | |
0 | 102 gboolean |
103 xmms_check_realtime_priority(void) | |
104 { | |
105 return FALSE; | |
106 } | |
107 | |
2053 | 108 /** |
109 * xmms_usleep: | |
110 * @usec: The amount of microseconds to sleep. | |
111 * | |
112 * Legacy function included for compatibility with XMMS. | |
113 **/ | |
0 | 114 void |
115 xmms_usleep(gint usec) | |
116 { | |
117 g_usleep(usec); | |
118 } |