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 } InterfaceOps; 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 } InterfaceCbs; 00064 00065 struct _Interface { 00066 gchar *id; /* simple ID like 'skinned' */ 00067 gchar *desc; /* description like 'Skinned Interface' */ 00068 gboolean (*init)(InterfaceCbs *cbs); /* init UI */ 00069 gboolean (*fini)(void); /* shutdown UI */ 00070 00071 InterfaceOps *ops; 00072 }; 00073 00074 #ifdef _AUDACIOUS_CORE 00075 00076 #include <gtk/gtk.h> 00077 #include <audacious/plugins.h> 00078 00079 PluginHandle * interface_get_default (void); 00080 void interface_set_default (PluginHandle * plugin); 00081 gboolean interface_load (PluginHandle * plugin); 00082 void interface_unload (void); 00083 00084 /* These functions have to be called from main thread 00085 Use event_queue if you need to call those from other threads */ 00086 void interface_show_prefs_window(gboolean show); 00087 void interface_run_filebrowser(gboolean play_button); 00088 void interface_hide_filebrowser(void); 00089 void interface_toggle_visibility(void); 00090 void interface_show_error_message(const gchar * markup); 00091 void interface_show_jump_to_track(void); 00092 void interface_add_plugin_widget (PluginHandle * plugin, GtkWidget * widget); 00093 void interface_remove_plugin_widget (PluginHandle * plugin, GtkWidget * widget); 00094 void interface_stop_gtk_plugin (void * parent); 00095 void interface_toggle_shuffle(void); 00096 void interface_toggle_repeat(void); 00097 00098 void register_interface_hooks(void); 00099 00100 #endif 00101 #endif