# HG changeset patch # User Tomasz Mon # Date 1212575785 -7200 # Node ID a2cbde1af409d1109fdb1fea1ec122f20230f241 # Parent aec8fc12e0751baedace8c63f30374bd778a0fe7 export create_widgets to PAPI diff -r aec8fc12e075 -r a2cbde1af409 src/audacious/Makefile --- a/src/audacious/Makefile Sat May 31 14:19:52 2008 +0200 +++ b/src/audacious/Makefile Wed Jun 04 12:36:25 2008 +0200 @@ -105,6 +105,7 @@ playlist.h \ playlist_container.h \ plugin.h \ + preferences.h \ strings.h \ tuple.h \ tuple_formatter.h \ diff -r aec8fc12e075 -r a2cbde1af409 src/audacious/plugin.h --- a/src/audacious/plugin.h Sat May 31 14:19:52 2008 +0200 +++ b/src/audacious/plugin.h Wed Jun 04 12:36:25 2008 +0200 @@ -44,6 +44,7 @@ #include "audacious/configdb.h" #include "audacious/playlist_container.h" #include "audacious/main.h" +#include "audacious/preferences.h" #define PLUGIN(x) ((Plugin *)(x)) #define INPUT_PLUGIN(x) ((InputPlugin *)(x)) @@ -649,6 +650,8 @@ void (*calc_mono_pcm)(gint16 dest[2][512], gint16 src[2][512], gint nch); void (*calc_stereo_pcm)(gint16 dest[2][512], gint16 src[2][512], gint nch); + void (*create_widgets)(GtkBox *box, PreferencesWidget *widgets, gint amt); + /* VFS endianess helper functions */ gboolean (*vfs_fget_le16)(guint16 *value, VFSFile *stream); gboolean (*vfs_fget_le32)(guint32 *value, VFSFile *stream); @@ -1006,6 +1009,8 @@ #define aud_calc_mono_pcm _audvt->calc_mono_pcm #define aud_calc_stereo_pcm _audvt->calc_stereo_pcm +#define aud_create_widgets _audvt->create_widgets + #include "audacious/auddrct.h" /* for multi-file plugins :( */ diff -r aec8fc12e075 -r a2cbde1af409 src/audacious/pluginenum.c --- a/src/audacious/pluginenum.c Sat May 31 14:19:52 2008 +0200 +++ b/src/audacious/pluginenum.c Wed Jun 04 12:36:25 2008 +0200 @@ -49,6 +49,7 @@ #include "output.h" #include "visualization.h" #include "discovery.h" +#include "preferences.h" #include "pluginenum.h" @@ -399,6 +400,8 @@ .calc_mono_freq = calc_mono_freq, .calc_mono_pcm = calc_mono_pcm, .calc_stereo_pcm = calc_stereo_pcm, + + .create_widgets = create_widgets, }; /*****************************************************************/ diff -r aec8fc12e075 -r a2cbde1af409 src/audacious/preferences.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/audacious/preferences.h Wed Jun 04 12:36:25 2008 +0200 @@ -0,0 +1,45 @@ +/* Audacious - Cross-platform multimedia player + * Copyright (C) 2008 Audacious development team. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * The Audacious team does not consider modular code linking to + * Audacious or using our public API to be a derived work. + */ + +#ifndef AUDACIOUS_PREFERENCES_H +#define AUDACIOUS_PREFERENCES_H + +typedef enum { + WIDGET_NONE, + WIDGET_CHK_BTN, + WIDGET_LABEL, + WIDGET_RADIO_BTN, + WIDGET_SPIN_BTN, + WIDGET_CUSTOM, /* 'custom' widget, you hand back the widget you want to add --nenolod */ + WIDGET_FONT_BTN, +} WidgetType; + +typedef struct { + WidgetType type; /* widget type */ + char *label; /* widget title (for SPIN_BTN it's text left to widget)*/ + gpointer cfg; /* connected config value */ + void (*callback) (void); /* this func will be called after value change, can be NULL */ + char *tooltip; /* widget tooltip (for SPIN_BTN it's text right to widget), can be NULL */ + gboolean child; + GtkWidget *(*populate) (void); /* for WIDGET_CUSTOM --nenolod */ +} PreferencesWidget; + +void create_widgets(GtkBox *box, PreferencesWidget *widgets, gint amt); + +#endif /* AUDACIOUS_PREFERENCES_H */ diff -r aec8fc12e075 -r a2cbde1af409 src/audacious/ui_preferences.c --- a/src/audacious/ui_preferences.c Sat May 31 14:19:52 2008 +0200 +++ b/src/audacious/ui_preferences.c Wed Jun 04 12:36:25 2008 +0200 @@ -51,6 +51,7 @@ #include "util.h" #include "dnd.h" #include "configdb.h" +#include "preferences.h" #include "ui_main.h" #include "ui_playlist.h" @@ -189,26 +190,6 @@ CategoryQueueEntry *category_queue = NULL; -typedef enum { - WIDGET_NONE, - WIDGET_CHK_BTN, - WIDGET_LABEL, - WIDGET_RADIO_BTN, - WIDGET_SPIN_BTN, - WIDGET_CUSTOM, /* 'custom' widget, you hand back the widget you want to add --nenolod */ - WIDGET_FONT_BTN, -} WidgetType; - -typedef struct { - WidgetType type; /* widget type */ - char *label; /* widget title (for SPIN_BTN it's text left to widget)*/ - gpointer cfg; /* connected config value */ - void (*callback) (void); /* this func will be called after value change, can be NULL */ - char *tooltip; /* widget tooltip (for SPIN_BTN it's text right to widget), can be NULL */ - gboolean child; - GtkWidget *(*populate) (void); /* for WIDGET_CUSTOM --nenolod */ -} PreferencesWidget; - static void playlist_show_pl_separator_numbers_cb(); static void show_wm_decorations_cb(); static void bitmap_fonts_cb(); @@ -1771,7 +1752,7 @@ } /* it's at early stage */ -static void +void create_widgets(GtkBox *box, PreferencesWidget *widgets, gint amt) { int x;