changeset 4598:a2cbde1af409

export create_widgets to PAPI
author Tomasz Mon <desowin@gmail.com>
date Wed, 04 Jun 2008 12:36:25 +0200
parents aec8fc12e075
children 93b9364bd731
files src/audacious/Makefile src/audacious/plugin.h src/audacious/pluginenum.c src/audacious/preferences.h src/audacious/ui_preferences.c
diffstat 5 files changed, 56 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- 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	\
--- 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 :( */
--- 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,
 };
 
 /*****************************************************************/
--- /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 <http://www.gnu.org/licenses>.
+ *
+ *  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 */
--- 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;