changeset 4517:6e412073cf28

cleaned up some more
author mf0102 <0102@gmx.at>
date Wed, 23 Apr 2008 22:20:35 +0200
parents 9fbb55542e73
children f2271d78e07e
files src/audacious/audconfig.c src/audacious/audconfig.h src/audacious/dock.c src/audacious/dock.h src/audacious/main.c src/audacious/main.h src/audacious/ui_equalizer.c src/audacious/ui_main.c src/audacious/ui_playlist.c src/audacious/ui_playlist_evlisteners.c src/audacious/ui_skinned_window.c
diffstat 11 files changed, 32 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/audconfig.c	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/audconfig.c	Wed Apr 23 22:20:35 2008 +0200
@@ -31,19 +31,21 @@
 #  include <samplerate.h>
 #endif
 
+#include "audconfig.h"
+
 #include "effect.h"
 #include "general.h"
 #include "playback.h"
 #include "pluginenum.h"
-#include "ui_skin.h"
 #include "ui_equalizer.h"
 #include "ui_playlist.h"
+#include "ui_skin.h"
 #include "ui_skinned_window.h"
 #include "ui_vis.h"
 #include "util.h"
 #include "visualization.h"
 
-#include "audconfig.h"
+AudConfig cfg;
 
 AudConfig aud_default_config = {
     .player_x = MAINWIN_DEFAULT_POS_X,
--- a/src/audacious/audconfig.h	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/audconfig.h	Wed Apr 23 22:20:35 2008 +0200
@@ -23,8 +23,10 @@
  *  Audacious or using our public API to be a derived work.
  */
 
-#ifndef BMPCONFIG_H
-#define BMPCONFIG_H
+#ifndef AUDCONFIG_H
+#define AUDCONFIG_H
+
+#include <glib.h>
 
 struct _AudConfig {
     gint player_x, player_y;
--- a/src/audacious/dock.c	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/dock.c	Wed Apr 23 22:20:35 2008 +0200
@@ -31,6 +31,8 @@
 
 #include "platform/smartinclude.h"
 
+static GList *dock_window_list = NULL;
+
 struct _DockedWindow {
     GtkWindow *w;
     gint offset_x, offset_y;
@@ -501,3 +503,8 @@
 get_dock_window_list() {
     return dock_window_list;
 }
+
+void
+set_dock_window_list(GList * list) {
+    dock_window_list = list;
+}
--- a/src/audacious/dock.h	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/dock.h	Wed Apr 23 22:20:35 2008 +0200
@@ -45,5 +45,6 @@
 void dock_window_resize(GtkWindow * widget, gint new_w, gint new_h, gint w, gint h);
 
 GList *get_dock_window_list();
+void set_dock_window_list(GList * list);
 
 #endif
--- a/src/audacious/main.c	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/main.c	Wed Apr 23 22:20:35 2008 +0200
@@ -89,8 +89,8 @@
 #include "icons-stock.h"
 #include "images/audacious_player.xpm"
 
-gboolean has_x11_connection = FALSE;    /* do we have an X11 connection? */
-const gchar *application_name = N_("Audacious");
+gboolean has_x11_connection = FALSE;  /* do we have an X11 connection? */
+static const gchar *application_name = N_("Audacious");
 
 struct _AudCmdLineOpt {
     gchar **filenames;
@@ -108,9 +108,7 @@
 
 typedef struct _AudCmdLineOpt AudCmdLineOpt;
 
-AudCmdLineOpt options;
-
-AudConfig cfg;
+static AudCmdLineOpt options;
 
 const gchar *aud_titlestring_presets[] = {
     "${title}",
@@ -120,7 +118,6 @@
     "${?artist:${artist} }${?album:[ ${album} ] }${?artist:- }${?track-number:${track-number}. }${title}",
     "${?album:${album} - }${title}"
 };
-
 const guint n_titlestring_presets = G_N_ELEMENTS(aud_titlestring_presets);
 
 const gchar *chardet_detector_presets[] = {
@@ -138,13 +135,10 @@
     N_("Universal")
 #endif
 };
+const guint n_chardet_detector_presets = G_N_ELEMENTS(chardet_detector_presets);
 
-const guint n_chardet_detector_presets = G_N_ELEMENTS(chardet_detector_presets);    
 gchar *aud_paths[BMP_PATH_COUNT] = {};
 
-GList *dock_window_list = NULL;
-
-
 GCond *cond_scan;
 GMutex *mutex_scan;
 #ifdef USE_DBUS
--- a/src/audacious/main.h	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/main.h	Wed Apr 23 22:20:35 2008 +0200
@@ -82,8 +82,6 @@
 extern const gchar *chardet_detector_presets[];
 extern const guint n_chardet_detector_presets;
 
-extern GList *dock_window_list;
-
 extern gboolean has_x11_connection;
 
 extern GCond *cond_scan;
--- a/src/audacious/ui_equalizer.c	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/ui_equalizer.c	Wed Apr 23 22:20:35 2008 +0200
@@ -145,7 +145,7 @@
     cfg.equalizer_shaded = shaded;
 
     if (shaded) {
-        dock_shade(dock_window_list, GTK_WINDOW(equalizerwin),
+        dock_shade(get_dock_window_list(), GTK_WINDOW(equalizerwin),
                    14 * EQUALIZER_SCALE_FACTOR);
         ui_skinned_set_push_button_data(equalizerwin_shade, -1, 3, -1, 47);
         ui_skinned_button_set_skin_index1(equalizerwin_shade, SKIN_EQ_EX);
@@ -155,7 +155,7 @@
         gtk_widget_show(equalizerwin_balance);
     }
     else {
-        dock_shade(dock_window_list, GTK_WINDOW(equalizerwin),
+        dock_shade(get_dock_window_list(), GTK_WINDOW(equalizerwin),
                    116 * EQUALIZER_SCALE_FACTOR);
         ui_skinned_set_push_button_data(equalizerwin_shade, -1, 137, -1, 38);
         ui_skinned_button_set_skin_index1(equalizerwin_shade, SKIN_EQMAIN);
@@ -229,7 +229,7 @@
 {
     if (event->button == 1 && event->type == GDK_BUTTON_PRESS &&
         (cfg.easy_move || cfg.equalizer_shaded || event->y < 14)) {
-         dock_move_press(dock_window_list, GTK_WINDOW(equalizerwin), event,
+         dock_move_press(get_dock_window_list(), GTK_WINDOW(equalizerwin), event,
                          FALSE);
     }
     else if (event->button == 1 && event->type == GDK_2BUTTON_PRESS
--- a/src/audacious/ui_main.c	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/ui_main.c	Wed Apr 23 22:20:35 2008 +0200
@@ -189,13 +189,13 @@
     cfg.player_shaded = shaded;
 
     if (shaded) {
-        dock_shade(dock_window_list, GTK_WINDOW(mainwin),
+        dock_shade(get_dock_window_list(), GTK_WINDOW(mainwin),
                    MAINWIN_SHADED_HEIGHT * MAINWIN_SCALE_FACTOR);
     } else {
         gint height = !aud_active_skin->properties.mainwin_height ? MAINWIN_HEIGHT :
             aud_active_skin->properties.mainwin_height;
 
-        dock_shade(dock_window_list, GTK_WINDOW(mainwin), height * MAINWIN_SCALE_FACTOR);
+        dock_shade(get_dock_window_list(), GTK_WINDOW(mainwin), height * MAINWIN_SCALE_FACTOR);
     }
 
     mainwin_refresh_hints();
@@ -777,7 +777,7 @@
 
     if (event->button == 1 && event->type == GDK_BUTTON_PRESS &&
         (cfg.easy_move || event->y < 14)) {
-        dock_move_press(dock_window_list, GTK_WINDOW(mainwin), event,
+        dock_move_press(get_dock_window_list(), GTK_WINDOW(mainwin), event,
                         TRUE);
     }
     else if (event->button == 1 && event->type == GDK_2BUTTON_PRESS && event->y < 14) {
--- a/src/audacious/ui_playlist.c	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/ui_playlist.c	Wed Apr 23 22:20:35 2008 +0200
@@ -346,7 +346,7 @@
         ui_skinned_set_push_button_data(playlistwin_close, 167, 3, -1, -1);
     }
 
-    dock_shade(dock_window_list, GTK_WINDOW(playlistwin),
+    dock_shade(get_dock_window_list(), GTK_WINDOW(playlistwin),
                playlistwin_get_height());
 
     playlistwin_set_geometry_hints(cfg.playlist_shaded);
@@ -1051,7 +1051,7 @@
     else if (event->button == 1 && event->type == GDK_BUTTON_PRESS &&
              (cfg.easy_move || event->y < 14))
     {
-        dock_move_press(dock_window_list, GTK_WINDOW(playlistwin), event,
+        dock_move_press(get_dock_window_list(), GTK_WINDOW(playlistwin), event,
                         FALSE);
     }
     else if (event->button == 1 && event->type == GDK_2BUTTON_PRESS
--- a/src/audacious/ui_playlist_evlisteners.c	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/ui_playlist_evlisteners.c	Wed Apr 23 22:20:35 2008 +0200
@@ -41,4 +41,4 @@
 {
     hook_associate("playlist update",
                    ui_playlist_evlistener_playlist_update, NULL);
-} 
+}
--- a/src/audacious/ui_skinned_window.c	Wed Apr 23 20:11:10 2008 +0200
+++ b/src/audacious/ui_skinned_window.c	Wed Apr 23 22:20:35 2008 +0200
@@ -272,8 +272,9 @@
                           GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK);
     gtk_widget_realize(GTK_WIDGET(widget));
 
-    dock_window_list = dock_window_set_decorated(dock_window_list,
-	GTK_WINDOW(widget), cfg.show_wm_decorations);
+    set_dock_window_list(dock_window_set_decorated(get_dock_window_list(),
+                                                   GTK_WINDOW(widget),
+                                                   cfg.show_wm_decorations));
     gtk_widget_set_app_paintable(GTK_WIDGET(widget), TRUE);
     gdk_window_set_back_pixmap(widget->window, NULL, FALSE);
     gtk_widget_shape_combine_mask(widget, NULL, 0, 0);