# HG changeset patch # User Yoshiki Yazawa # Date 1243001928 -32400 # Node ID 1ffcad5f406cb6f8e067b7f0f1bca67d4ecd23f3 # Parent 8b97f9560dc301c8c83cb7bd886161886bb92b15 import new skins plugin diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/plugin.c --- a/src/skins/plugin.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/plugin.c Fri May 22 23:18:48 2009 +0900 @@ -98,9 +98,16 @@ aud_hook_call("create prefswin", NULL); - if (config.player_visible) mainwin_real_show(); + if (config.player_visible) + mainwin_show (1); if (config.equalizer_visible) equalizerwin_show(TRUE); - if (config.playlist_visible) playlistwin_show(); + if (config.playlist_visible) + playlistwin_show (1); + + if (audacious_drct_get_playing ()) + ui_main_evlistener_playback_begin (0, 0); + if (audacious_drct_get_paused ()) + ui_main_evlistener_playback_pause (0, 0); g_message("Entering Gtk+ main loop!"); gtk_main(); diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/skins_cfg.c --- a/src/skins/skins_cfg.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/skins_cfg.c Fri May 22 23:18:48 2009 +0900 @@ -106,8 +106,6 @@ .show_separator_in_pl = TRUE, .playlist_font = NULL, .mainwin_font = NULL, - .show_filepopup_for_tuple = TRUE, - .filepopup_delay = 20, /* delay until the filepopup comes up */ .random_skin_on_play = FALSE, }; @@ -145,7 +143,6 @@ {"eq_scaled_linked", &config.eq_scaled_linked, TRUE}, {"show_numbers_in_pl", &config.show_numbers_in_pl, TRUE}, {"show_separator_in_pl", &config.show_separator_in_pl, TRUE}, - {"show_filepopup_for_tuple", &config.show_filepopup_for_tuple, TRUE}, {"random_skin_on_play", &config.random_skin_on_play, TRUE}, }; @@ -183,7 +180,6 @@ {"colorize_g", &config.colorize_g, TRUE}, {"colorize_b", &config.colorize_b, TRUE}, {"snap_distance", &config.snap_distance, TRUE}, - {"filepopup_delay", &config.filepopup_delay, TRUE}, }; static gint ncfgient = G_N_ELEMENTS(skins_numents); diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/skins_cfg.h --- a/src/skins/skins_cfg.h Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/skins_cfg.h Fri May 22 23:18:48 2009 +0900 @@ -75,8 +75,6 @@ gboolean eq_scaled_linked; gboolean show_numbers_in_pl, show_separator_in_pl; gchar *playlist_font, *mainwin_font; - gboolean show_filepopup_for_tuple; - gint filepopup_delay; gboolean random_skin_on_play; } skins_cfg_t; diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_dock.c --- a/src/skins/ui_dock.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_dock.c Fri May 22 23:18:48 2009 +0900 @@ -218,6 +218,30 @@ g_list_free(dlist); } +static void move_skinned_window (SkinnedWindow * window, int x, int y) +{ + gtk_window_move (GTK_WINDOW (window), x, y); + + window->x = x; + window->y = y; + + switch (window->type) + { + case WINDOW_MAIN: + config.player_x = x; + config.player_y = y; + break; + case WINDOW_EQ: + config.equalizer_x = x; + config.equalizer_y = y; + break; + case WINDOW_PLAYLIST: + config.playlist_x = x; + config.playlist_y = y; + break; + } +} + static void docked_list_move(GList * list, gint x, gint y) { @@ -226,29 +250,8 @@ for (node = list; node; node = g_list_next(node)) { dw = node->data; - gtk_window_move(dw->w, x + dw->offset_x, y + dw->offset_y); - - SkinnedWindow *window = SKINNED_WINDOW(dw->w); - if (window) { - switch(window->type) { - - case WINDOW_MAIN: - config.player_x = x + dw->offset_x; - config.player_y = y + dw->offset_y; - break; - case WINDOW_EQ: - config.equalizer_x = x + dw->offset_x; - config.equalizer_y = y + dw->offset_y; - break; - case WINDOW_PLAYLIST: - config.playlist_x = x + dw->offset_x; - config.playlist_y = y + dw->offset_y; - break; - } - - window->x = x + dw->offset_x; - window->y = y + dw->offset_y; - } + move_skinned_window (SKINNED_WINDOW (dw->w), x + dw->offset_x, + y + dw->offset_y); } } @@ -279,7 +282,7 @@ } for (; move; move = g_list_delete_link (move, move)) move_attached (move->data, others, offset); - gtk_window_move (window, x, y + offset); + move_skinned_window (SKINNED_WINDOW (window), x, y + offset); } void dock_shade (GList * window_list, GtkWindow * window, int new_height) { diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_equalizer.c --- a/src/skins/ui_equalizer.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_equalizer.c Fri May 22 23:18:48 2009 +0900 @@ -114,7 +114,7 @@ height = 116; if (config.scaled) { - dock_window_resize(GTK_WINDOW(equalizerwin), 275 * config.scale_factor, + dock_window_resize(GTK_WINDOW(equalizerwin), 275 * config.scale_factor, height * config.scale_factor); } else { dock_window_resize(GTK_WINDOW(equalizerwin), 275, height); @@ -371,7 +371,7 @@ ui_skinned_toggle_button_setup(equalizerwin_on, SKINNED_WINDOW(equalizerwin)->normal, 14, 18, 25, 12, 10, 119, 128, 119, 69, 119, 187, 119, SKIN_EQMAIN); g_signal_connect(equalizerwin_on, "clicked", equalizerwin_on_pushed, NULL); - equalizerwin_activate(aud_cfg->equalizer_active); + ui_skinned_button_set_inside (equalizerwin_on, aud_cfg->equalizer_active); equalizerwin_auto = ui_skinned_button_new(); ui_skinned_toggle_button_setup(equalizerwin_auto, SKINNED_WINDOW(equalizerwin)->normal, @@ -408,12 +408,14 @@ equalizerwin_graph = ui_skinned_equalizer_graph_new(SKINNED_WINDOW(equalizerwin)->normal, 86, 17); equalizerwin_preamp = ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->normal, 21, 38); - equalizerwin_set_preamp(aud_cfg->equalizer_preamp); + ui_skinned_equalizer_slider_set_position (equalizerwin_preamp, + aud_cfg->equalizer_preamp); for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) { equalizerwin_bands[i] = ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->normal, 78 + (i * 18), 38); - equalizerwin_set_band(i, aud_cfg->equalizer_bands[i]); + ui_skinned_equalizer_slider_set_position (equalizerwin_bands [i], + aud_cfg->equalizer_bands [i]); } equalizerwin_volume = @@ -490,22 +492,7 @@ equalizerwin_create_widgets(); } - -void -equalizerwin_show(gboolean show) -{ - GtkAction *action = gtk_action_group_get_action( - toggleaction_group_others , "show equalizer" ); - gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , show ); - - if (show) - equalizerwin_real_show(); - else - equalizerwin_real_hide(); -} - -void -equalizerwin_real_show(void) +static void equalizerwin_real_show (void) { gtk_window_move(GTK_WINDOW(equalizerwin), config.equalizer_x, config.equalizer_y); if (config.scaled && config.eq_scaled_linked) @@ -514,26 +501,40 @@ else gtk_widget_set_size_request(equalizerwin, 275, (config.equalizer_shaded ? 14 : 116)); - config.equalizer_visible = TRUE; ui_skinned_button_set_inside(mainwin_eq, TRUE); gtk_widget_show_all(equalizerwin); gtk_window_present(GTK_WINDOW(equalizerwin)); } -void -equalizerwin_real_hide(void) +static void equalizerwin_real_hide (void) { - /* - * This function should only be called from the - * main menu signal handler - */ gtk_widget_hide(equalizerwin); - config.equalizer_visible = FALSE; ui_skinned_button_set_inside(mainwin_eq, FALSE); gtk_widget_queue_draw(mainwin_eq); } +void +equalizerwin_show(gboolean show) +{ + GtkAction * a; + + a = gtk_action_group_get_action (toggleaction_group_others, "show equalizer"); + + if (a && gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (a)) != show) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (a), show); + else + { + config.equalizer_visible = show; + aud_cfg->equalizer_visible = show; + + if (show) + equalizerwin_real_show (); + else + equalizerwin_real_hide (); + } + } + static EqualizerPreset * equalizerwin_find_preset(GList * list, const gchar * name) { @@ -1007,7 +1008,7 @@ if (select_row_func) g_signal_connect(view, "row-activated", G_CALLBACK(select_row_func), NULL); - + gtk_box_pack_start(GTK_BOX(bbox), button_action, TRUE, TRUE, 0); gtk_widget_grab_default(button_action); @@ -1069,6 +1070,7 @@ { g_return_if_fail(band >= 0 && band < AUD_EQUALIZER_NBANDS); ui_skinned_equalizer_slider_set_position(equalizerwin_bands[band], value); + equalizerwin_eq_changed(); } gfloat @@ -1191,7 +1193,7 @@ gtk_window_present(GTK_WINDOW(equalizerwin_save_window)); return; } - + equalizerwin_create_list_window(equalizer_presets, Q_("Save preset"), &equalizerwin_save_window, @@ -1294,7 +1296,7 @@ gtk_window_present(GTK_WINDOW(equalizerwin_delete_window)); return; } - + equalizerwin_create_list_window(equalizer_presets, Q_("Delete preset"), &equalizerwin_delete_window, @@ -1311,7 +1313,7 @@ gtk_window_present(GTK_WINDOW(equalizerwin_delete_auto_window)); return; } - + equalizerwin_create_list_window(equalizer_auto_presets, Q_("Delete auto-preset"), &equalizerwin_delete_auto_window, diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_equalizer.h --- a/src/skins/ui_equalizer.h Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_equalizer.h Fri May 22 23:18:48 2009 +0900 @@ -47,8 +47,6 @@ void draw_equalizer_window(gboolean force); void equalizerwin_create(void); void equalizerwin_show(gboolean show); -void equalizerwin_real_show(void); -void equalizerwin_real_hide(void); void equalizerwin_load_auto_preset(const gchar * filename); void equalizerwin_set_volume_slider(gint percent); void equalizerwin_set_balance_slider(gint percent); diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_main.c --- a/src/skins/ui_main.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_main.c Fri May 22 23:18:48 2009 +0900 @@ -477,11 +477,31 @@ gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->normal), GTK_WIDGET(mainwin_info), aud_active_skin->properties.mainwin_text_x, aud_active_skin->properties.mainwin_text_y); + +#if 0 if (aud_active_skin->properties.mainwin_text_width) { UI_SKINNED_TEXTBOX(mainwin_info)->width = aud_active_skin->properties.mainwin_text_width; gtk_widget_set_size_request (mainwin_info, aud_active_skin->properties. mainwin_text_width * MAINWIN_SCALE_FACTOR, -1); } +#else + if (aud_active_skin->properties.mainwin_text_width) + UI_SKINNED_TEXTBOX(mainwin_info)->width = + aud_active_skin->properties.mainwin_text_width; + + if (aud_active_skin->properties.mainwin_text_height) + UI_SKINNED_TEXTBOX(mainwin_info)->height = + aud_active_skin->properties.mainwin_text_height; + + gtk_widget_set_size_request (mainwin_info, + aud_active_skin->properties. + mainwin_text_width * MAINWIN_SCALE_FACTOR, + aud_active_skin->properties. + mainwin_text_height * MAINWIN_SCALE_FACTOR); +#endif + + + if (aud_active_skin->properties.mainwin_infobar_x && aud_active_skin->properties.mainwin_infobar_y) gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->normal), GTK_WIDGET(mainwin_othertext), aud_active_skin->properties.mainwin_infobar_x, @@ -1345,10 +1365,7 @@ void mainwin_pl_pushed(gboolean toggled) { - if (toggled) - playlistwin_show(); - else - playlistwin_hide(); + playlistwin_show (toggled); } gint @@ -1568,22 +1585,8 @@ equalizerwin_set_balance_slider(b); } -void -mainwin_show(gboolean show) +static void mainwin_real_show (void) { - if (show) - mainwin_real_show(); - else - mainwin_real_hide(); -} - -void -mainwin_real_show(void) -{ - config.player_visible = TRUE; - - check_set( toggleaction_group_others , "show player" , TRUE ); - if (config.player_shaded) ui_vis_clear_data(mainwin_vis); @@ -1602,20 +1605,33 @@ gtk_window_present(GTK_WINDOW(mainwin)); } -void -mainwin_real_hide(void) +static void mainwin_real_hide (void) { - - check_set( toggleaction_group_others , "show player", FALSE); - if (config.player_shaded) ui_svis_clear_data(mainwin_svis); gtk_widget_hide(mainwin); - - config.player_visible = FALSE; } +void mainwin_show (gboolean show) +{ + GtkAction * a; + + a = gtk_action_group_get_action (toggleaction_group_others, "show player"); + + if (a && gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (a)) != show) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (a), show); + else + { + config.player_visible = show; + aud_cfg->player_visible = show; + + if (show) + mainwin_real_show (); + else + mainwin_real_hide (); + } +} void mainwin_set_stopaftersong(gboolean stop) @@ -1699,16 +1715,10 @@ mainwin_show(GTK_CHECK_MENU_ITEM(item)->active); break; case MAINWIN_GENERAL_SHOWPLWIN: - if (GTK_CHECK_MENU_ITEM(item)->active) - playlistwin_show(); - else - playlistwin_hide(); + playlistwin_show (GTK_CHECK_MENU_ITEM(item) ->active); break; case MAINWIN_GENERAL_SHOWEQWIN: - if (GTK_CHECK_MENU_ITEM(item)->active) - equalizerwin_real_show(); - else - equalizerwin_real_hide(); + equalizerwin_show (GTK_CHECK_MENU_ITEM (item)->active); break; case MAINWIN_GENERAL_PREV: aud_playlist_prev(playlist); @@ -2430,8 +2440,6 @@ g_free(time_str); } - time /= 1000; - length /= 1000; if (length > 0) { if (time > length) { ui_skinned_horizontal_slider_set_position(mainwin_position, 219); @@ -2588,19 +2596,13 @@ void action_show_equalizer( GtkToggleAction * action ) { - if (gtk_toggle_action_get_active(action)) - equalizerwin_real_show(); - else - equalizerwin_real_hide(); + equalizerwin_show (gtk_toggle_action_get_active (action)); } void action_show_playlist_editor( GtkToggleAction * action ) { - if (gtk_toggle_action_get_active(action)) - playlistwin_show(); - else - playlistwin_hide(); + playlistwin_show (gtk_toggle_action_get_active (action)); } void diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_main.h --- a/src/skins/ui_main.h Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_main.h Fri May 22 23:18:48 2009 +0900 @@ -148,8 +148,6 @@ void mainwin_set_balance_diff(gint diff); void mainwin_show(gboolean); -void mainwin_real_show(void); -void mainwin_real_hide(void); void mainwin_move(gint x, gint y); void mainwin_shuffle_pushed(gboolean toggled); void mainwin_repeat_pushed(gboolean toggled); diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_main_evlisteners.c --- a/src/skins/ui_main_evlisteners.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_main_evlisteners.c Fri May 22 23:18:48 2009 +0900 @@ -17,38 +17,22 @@ * The Audacious team does not consider modular code linking to * Audacious or using our public API to be a derived work. */ -#define UPDATEVIS 1 -#if 0 -#include "ui_playlist_evlisteners.h" -#endif #include #include -#if 0 -#include "hook.h" -#include "playback.h" -#include "playlist.h" -#include "playlist_evmessages.h" -#include "visualization.h" -#endif + #include #include -#if 0 -#include "ui_credits.h" -#endif + #include "ui_equalizer.h" #include "ui_main.h" #include "ui_playlist.h" -#if 0 -#include "ui_preferences.h" -#endif #include "ui_skinned_playstatus.h" #include "ui_skinned_textbox.h" #include "ui_skinned_window.h" #include "skins_cfg.h" static gint song_info_timeout_source = 0; -static gint update_vis_timeout_source = 0; typedef struct { gint bitrate; @@ -56,19 +40,6 @@ gint channels; } PlaylistEventInfoChange; -/* XXX: there has to be a better way than polling here! */ -/* also: where should this function go? should it stay here? --mf0102 */ -static gboolean -update_vis_func(gpointer unused) -{ - if (!audacious_drct_get_playing()) - return FALSE; -#if UPDATEVIS - aud_input_update_vis(audacious_drct_get_time()); -#endif - return TRUE; -} - static void ui_main_evlistener_title_change(gpointer hook_data, gpointer user_data) { @@ -106,12 +77,8 @@ equalizerwin_set_balance_slider(b); } -static void -ui_main_evlistener_playback_begin(gpointer hook_data, gpointer user_data) +void ui_main_evlistener_playback_begin (void * hook_data, void * user_data) { - PlaylistEntry *entry = (PlaylistEntry*)hook_data; - g_return_if_fail(entry != NULL); - ui_vis_clear_data(mainwin_vis); ui_svis_clear_data(mainwin_svis); mainwin_disable_seekbar(); @@ -130,14 +97,9 @@ gtk_widget_show(mainwin_position); } - song_info_timeout_source = - g_timeout_add_seconds(1, (GSourceFunc) mainwin_update_song_info, NULL); + song_info_timeout_source = + g_timeout_add (250, (GSourceFunc) mainwin_update_song_info, NULL); - update_vis_timeout_source = - g_timeout_add(10, (GSourceFunc) update_vis_func, NULL); -#if UPDATEVIS - aud_vis_playback_start(); -#endif ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_PLAY); } @@ -146,15 +108,11 @@ { if (song_info_timeout_source) g_source_remove(song_info_timeout_source); -#if UPDATEVIS - aud_vis_playback_stop(); - aud_free_vis_data(); -#endif + ui_skinned_playstatus_set_buffering(mainwin_playstatus, FALSE); } -static void -ui_main_evlistener_playback_pause(gpointer hook_data, gpointer user_data) +void ui_main_evlistener_playback_pause (void * hook_data, void * user_data) { ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_PAUSE); } @@ -166,14 +124,6 @@ } static void -ui_main_evlistener_playback_seek(gpointer hook_data, gpointer user_data) -{ -#if UPDATEVIS - aud_free_vis_data(); -#endif -} - -static void ui_main_evlistener_playback_play_file(gpointer hook_data, gpointer user_data) { if (config.random_skin_on_play) @@ -407,7 +357,6 @@ aud_hook_associate("playback stop", ui_main_evlistener_playback_stop, NULL); aud_hook_associate("playback pause", ui_main_evlistener_playback_pause, NULL); aud_hook_associate("playback unpause", ui_main_evlistener_playback_unpause, NULL); - aud_hook_associate("playback seek", ui_main_evlistener_playback_seek, NULL); aud_hook_associate("playback play file", ui_main_evlistener_playback_play_file, NULL); aud_hook_associate("playlist end reached", ui_main_evlistener_playlist_end_reached, NULL); aud_hook_associate("playlist info change", ui_main_evlistener_playlist_info_change, NULL); @@ -433,18 +382,12 @@ aud_hook_dissociate("playback stop", ui_main_evlistener_playback_stop); aud_hook_dissociate("playback pause", ui_main_evlistener_playback_pause); aud_hook_dissociate("playback unpause", ui_main_evlistener_playback_unpause); - aud_hook_dissociate("playback seek", ui_main_evlistener_playback_seek); aud_hook_dissociate("playback play file", ui_main_evlistener_playback_play_file); aud_hook_dissociate("playlist end reached", ui_main_evlistener_playlist_end_reached); aud_hook_dissociate("playlist info change", ui_main_evlistener_playlist_info_change); aud_hook_dissociate("mainwin set always on top", ui_main_evlistener_mainwin_set_always_on_top); aud_hook_dissociate("mainwin show", ui_main_evlistener_mainwin_show); aud_hook_dissociate("equalizerwin show", ui_main_evlistener_equalizerwin_show); -#if 0 - aud_hook_dissociate("prefswin show", ui_main_evlistener_prefswin_show); - aud_hook_dissociate("aboutwin show", ui_main_evlistener_aboutwin_show); - aud_hook_dissociate("ui jump to track show", ui_main_evlistener_ui_jump_to_track_show); -#endif aud_hook_dissociate("visualization timeout", ui_main_evlistener_visualization_timeout); aud_hook_dissociate("config save", ui_main_evlistener_config_save); diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_main_evlisteners.h --- a/src/skins/ui_main_evlisteners.h Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_main_evlisteners.h Fri May 22 23:18:48 2009 +0900 @@ -26,4 +26,7 @@ void ui_main_evlistener_init(void); void ui_main_evlistener_dissociate(void); +void ui_main_evlistener_playback_begin (void * hook_data, void * user_data); +void ui_main_evlistener_playback_pause (void * hook_data, void * user_data); + #endif /* AUDACIOUS_UI_MAIN_EVLISTENERS_H */ diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_manager.c --- a/src/skins/ui_manager.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_manager.c Fri May 22 23:18:48 2009 +0900 @@ -657,11 +657,11 @@ mainwin_playlist_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/playlist" ); mainwin_view_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/view" ); mainwin_general_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu" ); - +#if 0 gtk_menu_item_set_submenu (GTK_MENU_ITEM (gtk_ui_manager_get_widget (ui_manager, "/mainwin-menus/main-menu/plugins-menu")), aud_get_plugin_menu (AUDACIOUS_MENU_MAIN)); - +#endif #ifdef GDK_WINDOWING_QUARTZ gtk_ui_manager_add_ui_from_file( ui_manager , DATA_DIR "/ui/carbon-menubar.ui" , &gerr ); @@ -693,6 +693,7 @@ playlistwin_plsort_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/misc-menu"); playlistwin_pllist_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/playlist-menu"); +#if 0 gtk_menu_item_set_submenu (GTK_MENU_ITEM (gtk_ui_manager_get_widget (ui_manager, "/playlist-menus/playlist-menu/plugins-menu")), aud_get_plugin_menu (AUDACIOUS_MENU_PLAYLIST)); @@ -711,6 +712,7 @@ gtk_menu_item_set_submenu (GTK_MENU_ITEM (gtk_ui_manager_get_widget (ui_manager, "/playlist-menus/misc-menu/plugins-menu")), aud_get_plugin_menu (AUDACIOUS_MENU_PLAYLIST_MISC)); +#endif gtk_ui_manager_add_ui_from_file( ui_manager , DATA_DIR "/ui/equalizer.ui" , &gerr ); diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_playlist.c --- a/src/skins/ui_playlist.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_playlist.c Fri May 22 23:18:48 2009 +0900 @@ -23,8 +23,7 @@ * Audacious or using our public API to be a derived work. */ -#define AUD_DEBUG 1 -#define CONDSCAN 1 +/* #define AUD_DEBUG 1 */ #include "ui_playlist.h" @@ -60,8 +59,6 @@ #include "icons-stock.h" #include "images/audacious_playlist.xpm" -#include - GtkWidget *playlistwin; static GMutex *resize_mutex = NULL; @@ -89,10 +86,6 @@ static gboolean playlistwin_resizing = FALSE; static gint playlistwin_resize_x, playlistwin_resize_y; -/* #if CONDSCAN */ -/* extern GCond *cond_scan; */ -/* #endif */ - gboolean playlistwin_is_shaded(void) { @@ -257,11 +250,8 @@ { if (UI_SKINNED_IS_PLAYLIST(playlistwin_list)) UI_SKINNED_PLAYLIST(playlistwin_list)->first = toprow; -#if CONDSCAN - GCond *cond_scan = aud_get_cond_scan(); - AUDDBG("cond_scan = %p\n", cond_scan); - if(cond_scan) - g_cond_signal(cond_scan); +#if 0 + g_cond_signal(cond_scan); #endif playlistwin_update_list(aud_playlist_get_active()); } @@ -962,11 +952,8 @@ if (event->direction == GDK_SCROLL_UP) playlistwin_scroll(-config.scroll_pl_by); -#if CONDSCAN - GCond *cond_scan = aud_get_cond_scan(); - AUDDBG("cond_scan = %p\n", cond_scan); - if(cond_scan) - g_cond_signal(cond_scan); +#if 0 + g_cond_signal(cond_scan); #endif } @@ -1068,7 +1055,7 @@ static gboolean playlistwin_delete(GtkWidget * w, gpointer data) { - playlistwin_hide(); + playlistwin_show (0); return TRUE; } @@ -1246,15 +1233,12 @@ default: return FALSE; } -#if CONDSCAN if (refresh) { - GCond *cond_scan = aud_get_cond_scan(); - AUDDBG("cond_scan = %p\n", cond_scan); - if(cond_scan) - g_cond_signal(cond_scan); +#if 0 + g_cond_signal(cond_scan); +#endif playlistwin_update_list(aud_playlist_get_active()); } -#endif return TRUE; } @@ -1359,6 +1343,11 @@ aud_playlist_next(aud_playlist_get_active()); } +static void playlistwin_hide (void) +{ + playlistwin_show (0); +} + static void playlistwin_create_widgets(void) { @@ -1565,17 +1554,9 @@ gtk_window_add_accel_group(GTK_WINDOW(playlistwin), ui_manager_get_accel_group()); } - -void -playlistwin_show(void) +static void playlistwin_real_show (void) { - GtkAction *action = gtk_action_group_get_action( - toggleaction_group_others , "show playlist editor" ); - gtk_window_move(GTK_WINDOW(playlistwin), config.playlist_x, config.playlist_y); - gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , TRUE ); - - config.playlist_visible = TRUE; ui_skinned_button_set_inside(mainwin_pl, TRUE); playlistwin_set_toprow(0); @@ -1586,15 +1567,9 @@ gtk_window_present(GTK_WINDOW(playlistwin)); } -void -playlistwin_hide(void) +static void playlistwin_real_hide (void) { - GtkAction *action = gtk_action_group_get_action( - toggleaction_group_others , "show playlist editor" ); - gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , FALSE ); - gtk_widget_hide(playlistwin); - config.playlist_visible = FALSE; ui_skinned_button_set_inside(mainwin_pl, FALSE); if ( config.player_visible ) @@ -1604,6 +1579,26 @@ } } +void playlistwin_show (char show) +{ + GtkAction * a; + + a = gtk_action_group_get_action (toggleaction_group_others, "show playlist editor"); + + if (a && gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (a)) != show) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (a), show); + else + { + config.playlist_visible = show; + aud_cfg->playlist_visible = show; + + if (show) + playlistwin_real_show (); + else + playlistwin_real_hide (); + } +} + void action_playlist_track_info(void) { playlistwin_fileinfo(); diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_playlist.h --- a/src/skins/ui_playlist.h Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_playlist.h Fri May 22 23:18:48 2009 +0900 @@ -63,8 +63,7 @@ void playlistwin_create(void); void playlistwin_hide_timer(void); void playlistwin_set_time(gint time, gint length, TimerMode mode); -void playlistwin_show(void); -void playlistwin_hide(void); +void playlistwin_show (char show); void playlistwin_scroll(gint num); void playlistwin_scroll_up_pushed(void); void playlistwin_scroll_down_pushed(void); diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_playlist_evlisteners.c --- a/src/skins/ui_playlist_evlisteners.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_playlist_evlisteners.c Fri May 22 23:18:48 2009 +0900 @@ -44,10 +44,7 @@ ui_playlist_evlistener_playlistwin_show(gpointer hook_data, gpointer user_data) { gboolean *show = (gboolean*)hook_data; - if (*show == TRUE) - playlistwin_show(); - else - playlistwin_hide(); + playlistwin_show (* show); } void ui_playlist_evlistener_init(void) diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_skin.c --- a/src/skins/ui_skin.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_skin.c Fri May 22 23:18:48 2009 +0900 @@ -710,6 +710,14 @@ g_free(tmp); } + tmp = aud_read_ini_string(inifile, "skin", "mainwinTextHeight"); + + if (tmp != NULL) + { + skin->properties.mainwin_text_height = atoi(tmp); + g_free(tmp); + } + tmp = aud_read_ini_string(inifile, "skin", "mainwinInfoBarX"); if (tmp != NULL) diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_skin.h --- a/src/skins/ui_skin.h Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_skin.h Fri May 22 23:18:48 2009 +0900 @@ -83,6 +83,7 @@ gint mainwin_text_x; gint mainwin_text_y; gint mainwin_text_width; + gint mainwin_text_height; gboolean mainwin_text_visible; /* Infobar properties */ @@ -109,10 +110,10 @@ gint mainwin_playstatus_y; gint mainwin_volume_x; - gint mainwin_volume_y; + gint mainwin_volume_y; gint mainwin_balance_x; - gint mainwin_balance_y; + gint mainwin_balance_y; gint mainwin_position_x; gint mainwin_position_y; diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_skinned_playlist.c --- a/src/skins/ui_skinned_playlist.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_skinned_playlist.c Fri May 22 23:18:48 2009 +0900 @@ -958,7 +958,7 @@ playlistwin_update_list(aud_playlist_get_active()); } priv->drag_pos = nr; - } else if (config.show_filepopup_for_tuple) { + } else if (aud_cfg->show_filepopup_for_tuple) { gint pos = ui_skinned_playlist_get_position(widget, event->x, event->y); if (pos == -1) { ui_skinned_playlist_popup_hide (widget); @@ -1070,7 +1070,10 @@ } static void ui_skinned_playlist_popup_timer_start(GtkWidget *widget) { - gint timer_id = g_timeout_add(config.filepopup_delay*100, ui_skinned_playlist_popup_show, widget); + int timer_id; + + timer_id = g_timeout_add (aud_cfg->filepopup_delay * 100, + ui_skinned_playlist_popup_show, widget); g_object_set_data(G_OBJECT(widget), "timer_id", GINT_TO_POINTER(timer_id)); g_object_set_data(G_OBJECT(widget), "timer_active", GINT_TO_POINTER(1)); } diff -r 8b97f9560dc3 -r 1ffcad5f406c src/skins/ui_skinned_textbox.c --- a/src/skins/ui_skinned_textbox.c Fri May 01 16:59:54 2009 -0400 +++ b/src/skins/ui_skinned_textbox.c Fri May 22 23:18:48 2009 +0900 @@ -363,10 +363,14 @@ } } +#if 1 ui_skinned_widget_draw_with_coordinates(widget, obj, textbox->width, textbox->height, widget->allocation.x, widget->allocation.y, priv->scaled); +#else + ui_skinned_widget_draw(widget, obj, textbox->width, textbox->height, priv->scaled); +#endif g_object_unref(obj); } @@ -521,9 +525,23 @@ if (priv->font == NULL) return; +#if 0 textbox->height = priv->font_ascent; /* The real height of the text is ascent - descent (descent is negative), but we cut off descent pixels from the top to make it fit better. See textbox_generate_xfont_pixmap. */ +//#else + textbox->height = priv->font_ascent; + if (textbox->height > priv->nominal_height) + textbox->y -= (textbox->height - priv->nominal_height) / 2; + else + textbox->height = priv->nominal_height; +#endif +#if 0 + textbox->height = priv->font_ascent = priv->font_descent; + printf("font_ascent = %d font_descent = %d textbox->height = %d \n", priv->font_ascent, priv->font_descent, textbox->height); +#endif + textbox->height = 40; + } void ui_skinned_textbox_set_text(GtkWidget *widget, const gchar *text) {