00001 /* 00002 * eventqueue.h 00003 * Copyright 2011 John Lindgren 00004 * 00005 * This file is part of Audacious. 00006 * 00007 * Audacious is free software: you can redistribute it and/or modify it under 00008 * the terms of the GNU General Public License as published by the Free Software 00009 * Foundation, version 2 or version 3 of the License. 00010 * 00011 * Audacious is distributed in the hope that it will be useful, but WITHOUT ANY 00012 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00013 * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along with 00016 * Audacious. If not, see <http://www.gnu.org/licenses/>. 00017 * 00018 * The Audacious team does not consider modular code linking to Audacious or 00019 * using our public API to be a derived work. 00020 */ 00021 00022 #ifndef AUDACIOUS_EVENTQUEUE_H 00023 #define AUDACIOUS_EVENTQUEUE_H 00024 00025 #include <glib.h> 00026 00027 /* Schedules a call of the hook <name> from the program's main loop, to be 00028 * executed in <time> milliseconds. If <free_data> is nonzero, <data> will be 00029 * freed with g_free() after the hook is called. */ 00030 void event_queue_full (gint time, const gchar * name, void * data, gboolean free_data); 00031 00032 /* convenience macro */ 00033 #define event_queue(n,d) event_queue_full (0, n, d, FALSE) 00034 00035 /* deprecated; use event_queue_full() instead */ 00036 #define event_queue_timed(t,n,d) event_queue_full (t, n, d, FALSE) 00037 #define event_queue_with_data_free(n,d) event_queue_full (0, n, d, TRUE) 00038 00039 /* Cancels pending hook calls matching <name> and <data>. If <data> is null, 00040 * all hook calls matching <name> are canceled. */ 00041 void event_queue_cancel (const gchar * name, void * data); 00042 00043 #endif