changeset 4667:2079f04c19e2

Use new Interface API.
author William Pitcock <nenolod@atheme.org>
date Sun, 29 Jun 2008 00:45:55 -0500
parents 742abc97b3ab
children fdcbbfdd428e
files src/audacious/main.c src/audacious/ui_new.c src/audacious/ui_new.h
diffstat 3 files changed, 29 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/main.c	Sun Jun 29 00:38:08 2008 -0500
+++ b/src/audacious/main.c	Sun Jun 29 00:45:55 2008 -0500
@@ -763,6 +763,8 @@
     output_set_volume((cfg.saved_volume & 0xff00) >> 8,
                       (cfg.saved_volume & 0x00ff));
 
+    ui_populate_default_interface();
+
     if (options.headless == FALSE)
     {
         g_message("GUI and skin setup");
@@ -823,9 +825,9 @@
     // if we are running headless
     else
     {
-        /* temporarily headless operation is disabled in favour of
-         * testing the new UI */
-        ui_initialize();
+        /* temporarily headless operation is disabled in favour of testing the new UI */
+        Interface *i = interface_get("default"); /* XXX */
+        interface_run(i);
 
 #if 0
         g_print(_("Headless operation enabled\n"));
--- a/src/audacious/ui_new.c	Sun Jun 29 00:38:08 2008 -0500
+++ b/src/audacious/ui_new.c	Sun Jun 29 00:45:55 2008 -0500
@@ -17,10 +17,13 @@
  *  Audacious or using our public API to be a derived work.
  */
 
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
+#include "interface.h"
 #include "playlist.h"
 #include "ui_fileopener.h"
+#include "ui_new.h"
 
 static GtkWidget *label_prev, *label_current, *label_next;
 
@@ -84,8 +87,8 @@
     return label;
 }
 
-void
-ui_initialize()
+static gboolean
+_ui_initialize(void)
 {
     GtkWidget *window;		/* the main window */
     GtkWidget *vbox;		/* the main vertical box */
@@ -142,4 +145,20 @@
 
     gtk_widget_show_all(window);
     gtk_main();
+
+    return TRUE;
 }
+
+static Interface default_interface = {
+    .id = "default",
+    .desc = N_("Default Interface"),
+    .init = _ui_initialize,
+};
+
+Interface *
+ui_populate_default_interface(void)
+{
+    interface_register(&default_interface);
+
+    return &default_interface;
+}
--- a/src/audacious/ui_new.h	Sun Jun 29 00:38:08 2008 -0500
+++ b/src/audacious/ui_new.h	Sun Jun 29 00:45:55 2008 -0500
@@ -17,9 +17,11 @@
  *  Audacious or using our public API to be a derived work.
  */
 
+#include "interface.h"
+
 #ifndef UI_NEW_H
 #define UI_NEW_H
 
-void ui_initialize();
+Interface *ui_populate_default_interface();
 
 #endif