Audacious  $Id:Doxyfile42802007-03-2104:39:00Znenolod$
interface.h
Go to the documentation of this file.
00001 /*
00002  * Audacious2
00003  * Copyright (c) 2008 William Pitcock <nenolod@dereferenced.org>
00004  * Copyright (c) 2008-2009 Tomasz Moń <desowin@gmail.com>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; under version 3 of the License.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program.  If not, see <http://www.gnu.org/licenses>.
00017  *
00018  * The Audacious team does not consider modular code linking to
00019  * Audacious or using our public API to be a derived work.
00020  */
00021 
00022 /*
00023  * This is the Interface API.
00024  *
00025  * Everything here is like totally subject to change.
00026  *     --nenolod
00027  */
00028 
00029 #ifndef __AUDACIOUS2_INTERFACE_H__
00030 #define __AUDACIOUS2_INTERFACE_H__
00031 
00032 #include <glib.h>
00033 #include <audacious/types.h>
00034 
00035 typedef struct {
00036     /* GtkWidget * * (* create_prefs_window) (void); */
00037     void * * (* create_prefs_window) (void);
00038     void (*show_prefs_window)(void);
00039     void (*hide_prefs_window)(void);
00040     void (*destroy_prefs_window)(void);
00041     /* gint (* prefswin_page_new) (GtkWidget * container, const gchar * name,
00042      const gchar * imgurl); */
00043     gint (* prefswin_page_new) (void * container, const gchar * name,
00044      const gchar * imgurl);
00045 } IfaceOps;
00046 
00047 typedef struct {
00048     void (*show_prefs_window)(gboolean show);
00049     void (*run_filebrowser)(gboolean play_button);
00050     void (*hide_filebrowser)(void);
00051     void (*toggle_visibility)(void);
00052     void (*show_error)(const gchar * markup);
00053     void (*show_jump_to_track)(void);
00054     void (*hide_jump_to_track)(void);
00055     void (*show_about_window)(void);
00056     void (*hide_about_window)(void);
00057     void (*toggle_shuffle)(void);
00058     void (*toggle_repeat)(void);
00059     /* GtkWidget * (* run_gtk_plugin) (GtkWidget * parent, const gchar * name); */
00060     void * (* run_gtk_plugin) (void * parent, const gchar * name);
00061     /* GtkWidget * (* stop_gtk_plugin) (GtkWidget * parent); */
00062     void * (* stop_gtk_plugin) (void * parent);
00063 
00064     void (*install_toolbar)(void * button);
00065     void (*uninstall_toolbar)(void * button);
00066 } IfaceCbs;
00067 
00068 struct _Iface {
00069     gchar *id;                           /* simple ID like 'skinned' */
00070     gchar *desc;                         /* description like 'Skinned Interface' */
00071     gboolean (*init)(IfaceCbs *cbs); /* init UI */
00072     gboolean (*fini)(void);              /* shutdown UI */
00073 
00074     IfaceOps *ops;
00075 };
00076 
00077 #ifdef _AUDACIOUS_CORE
00078 
00079 #include <gtk/gtk.h>
00080 #include <audacious/plugins.h>
00081 
00082 gboolean interface_load (PluginHandle * plugin);
00083 void interface_unload (void);
00084 
00085 /* These functions have to be called from main thread
00086    Use event_queue if you need to call those from other threads */
00087 void interface_show_prefs_window(gboolean show);
00088 void interface_run_filebrowser(gboolean play_button);
00089 void interface_hide_filebrowser(void);
00090 void interface_toggle_visibility(void);
00091 void interface_show_error_message(const gchar * markup);
00092 void interface_show_jump_to_track(void);
00093 void interface_add_plugin_widget (PluginHandle * plugin, GtkWidget * widget);
00094 void interface_remove_plugin_widget (PluginHandle * plugin, GtkWidget * widget);
00095 void interface_stop_gtk_plugin (void * parent);
00096 void interface_toggle_shuffle(void);
00097 void interface_toggle_repeat(void);
00098 
00099 void register_interface_hooks(void);
00100 
00101 PluginHandle * iface_plugin_probe (void);
00102 PluginHandle * iface_plugin_get_current (void);
00103 gboolean iface_plugin_set_current (PluginHandle * plugin);
00104 
00105 #endif
00106 #endif