comparison src/skins/ui_playlist.c @ 3159:1ffcad5f406c

import new skins plugin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 22 May 2009 23:18:48 +0900
parents 9978be206b93
children
comparison
equal deleted inserted replaced
3158:8b97f9560dc3 3159:1ffcad5f406c
21 * 21 *
22 * The Audacious team does not consider modular code linking to 22 * The Audacious team does not consider modular code linking to
23 * Audacious or using our public API to be a derived work. 23 * Audacious or using our public API to be a derived work.
24 */ 24 */
25 25
26 #define AUD_DEBUG 1 26 /* #define AUD_DEBUG 1 */
27 #define CONDSCAN 1
28 27
29 #include "ui_playlist.h" 28 #include "ui_playlist.h"
30 29
31 #include <glib.h> 30 #include <glib.h>
32 #include <glib/gi18n.h> 31 #include <glib/gi18n.h>
58 #include "ui_skinned_playlist.h" 57 #include "ui_skinned_playlist.h"
59 58
60 #include "icons-stock.h" 59 #include "icons-stock.h"
61 #include "images/audacious_playlist.xpm" 60 #include "images/audacious_playlist.xpm"
62 61
63 #include <audlegacy/main.h>
64
65 GtkWidget *playlistwin; 62 GtkWidget *playlistwin;
66 63
67 static GMutex *resize_mutex = NULL; 64 static GMutex *resize_mutex = NULL;
68 65
69 static GtkWidget *playlistwin_list = NULL; 66 static GtkWidget *playlistwin_list = NULL;
86 GdkEventKey *event, 83 GdkEventKey *event,
87 gpointer searchdlg_win); 84 gpointer searchdlg_win);
88 85
89 static gboolean playlistwin_resizing = FALSE; 86 static gboolean playlistwin_resizing = FALSE;
90 static gint playlistwin_resize_x, playlistwin_resize_y; 87 static gint playlistwin_resize_x, playlistwin_resize_y;
91
92 /* #if CONDSCAN */
93 /* extern GCond *cond_scan; */
94 /* #endif */
95 88
96 gboolean 89 gboolean
97 playlistwin_is_shaded(void) 90 playlistwin_is_shaded(void)
98 { 91 {
99 return config.playlist_shaded; 92 return config.playlist_shaded;
255 void 248 void
256 playlistwin_set_toprow(gint toprow) 249 playlistwin_set_toprow(gint toprow)
257 { 250 {
258 if (UI_SKINNED_IS_PLAYLIST(playlistwin_list)) 251 if (UI_SKINNED_IS_PLAYLIST(playlistwin_list))
259 UI_SKINNED_PLAYLIST(playlistwin_list)->first = toprow; 252 UI_SKINNED_PLAYLIST(playlistwin_list)->first = toprow;
260 #if CONDSCAN 253 #if 0
261 GCond *cond_scan = aud_get_cond_scan(); 254 g_cond_signal(cond_scan);
262 AUDDBG("cond_scan = %p\n", cond_scan);
263 if(cond_scan)
264 g_cond_signal(cond_scan);
265 #endif 255 #endif
266 playlistwin_update_list(aud_playlist_get_active()); 256 playlistwin_update_list(aud_playlist_get_active());
267 } 257 }
268 258
269 void 259 void
960 if (event->direction == GDK_SCROLL_DOWN) 950 if (event->direction == GDK_SCROLL_DOWN)
961 playlistwin_scroll(config.scroll_pl_by); 951 playlistwin_scroll(config.scroll_pl_by);
962 952
963 if (event->direction == GDK_SCROLL_UP) 953 if (event->direction == GDK_SCROLL_UP)
964 playlistwin_scroll(-config.scroll_pl_by); 954 playlistwin_scroll(-config.scroll_pl_by);
965 #if CONDSCAN 955 #if 0
966 GCond *cond_scan = aud_get_cond_scan(); 956 g_cond_signal(cond_scan);
967 AUDDBG("cond_scan = %p\n", cond_scan);
968 if(cond_scan)
969 g_cond_signal(cond_scan);
970 #endif 957 #endif
971 } 958 }
972 959
973 static gboolean 960 static gboolean
974 playlistwin_press(GtkWidget * widget, 961 playlistwin_press(GtkWidget * widget,
1066 } 1053 }
1067 1054
1068 static gboolean 1055 static gboolean
1069 playlistwin_delete(GtkWidget * w, gpointer data) 1056 playlistwin_delete(GtkWidget * w, gpointer data)
1070 { 1057 {
1071 playlistwin_hide(); 1058 playlistwin_show (0);
1072 return TRUE; 1059 return TRUE;
1073 } 1060 }
1074 1061
1075 static gboolean 1062 static gboolean
1076 playlistwin_keypress_up_down_handler(UiSkinnedPlaylist * pl, 1063 playlistwin_keypress_up_down_handler(UiSkinnedPlaylist * pl,
1244 refresh = TRUE; 1231 refresh = TRUE;
1245 break; 1232 break;
1246 default: 1233 default:
1247 return FALSE; 1234 return FALSE;
1248 } 1235 }
1249 #if CONDSCAN
1250 if (refresh) { 1236 if (refresh) {
1251 GCond *cond_scan = aud_get_cond_scan(); 1237 #if 0
1252 AUDDBG("cond_scan = %p\n", cond_scan); 1238 g_cond_signal(cond_scan);
1253 if(cond_scan) 1239 #endif
1254 g_cond_signal(cond_scan);
1255 playlistwin_update_list(aud_playlist_get_active()); 1240 playlistwin_update_list(aud_playlist_get_active());
1256 } 1241 }
1257 #endif
1258 return TRUE; 1242 return TRUE;
1259 } 1243 }
1260 1244
1261 void 1245 void
1262 playlistwin_hide_timer(void) 1246 playlistwin_hide_timer(void)
1355 1339
1356 static void 1340 static void
1357 local_playlist_next(void) 1341 local_playlist_next(void)
1358 { 1342 {
1359 aud_playlist_next(aud_playlist_get_active()); 1343 aud_playlist_next(aud_playlist_get_active());
1344 }
1345
1346 static void playlistwin_hide (void)
1347 {
1348 playlistwin_show (0);
1360 } 1349 }
1361 1350
1362 static void 1351 static void
1363 playlistwin_create_widgets(void) 1352 playlistwin_create_widgets(void)
1364 { 1353 {
1563 playlistwin_update_info(aud_playlist_get_active()); 1552 playlistwin_update_info(aud_playlist_get_active());
1564 1553
1565 gtk_window_add_accel_group(GTK_WINDOW(playlistwin), ui_manager_get_accel_group()); 1554 gtk_window_add_accel_group(GTK_WINDOW(playlistwin), ui_manager_get_accel_group());
1566 } 1555 }
1567 1556
1568 1557 static void playlistwin_real_show (void)
1569 void 1558 {
1570 playlistwin_show(void)
1571 {
1572 GtkAction *action = gtk_action_group_get_action(
1573 toggleaction_group_others , "show playlist editor" );
1574
1575 gtk_window_move(GTK_WINDOW(playlistwin), config.playlist_x, config.playlist_y); 1559 gtk_window_move(GTK_WINDOW(playlistwin), config.playlist_x, config.playlist_y);
1576 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , TRUE );
1577
1578 config.playlist_visible = TRUE;
1579 ui_skinned_button_set_inside(mainwin_pl, TRUE); 1560 ui_skinned_button_set_inside(mainwin_pl, TRUE);
1580 1561
1581 playlistwin_set_toprow(0); 1562 playlistwin_set_toprow(0);
1582 1563
1583 gtk_widget_show_all(playlistwin); 1564 gtk_widget_show_all(playlistwin);
1584 if (!config.playlist_shaded) 1565 if (!config.playlist_shaded)
1585 gtk_widget_hide(playlistwin_sinfo); 1566 gtk_widget_hide(playlistwin_sinfo);
1586 gtk_window_present(GTK_WINDOW(playlistwin)); 1567 gtk_window_present(GTK_WINDOW(playlistwin));
1587 } 1568 }
1588 1569
1589 void 1570 static void playlistwin_real_hide (void)
1590 playlistwin_hide(void) 1571 {
1591 {
1592 GtkAction *action = gtk_action_group_get_action(
1593 toggleaction_group_others , "show playlist editor" );
1594 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , FALSE );
1595
1596 gtk_widget_hide(playlistwin); 1572 gtk_widget_hide(playlistwin);
1597 config.playlist_visible = FALSE;
1598 ui_skinned_button_set_inside(mainwin_pl, FALSE); 1573 ui_skinned_button_set_inside(mainwin_pl, FALSE);
1599 1574
1600 if ( config.player_visible ) 1575 if ( config.player_visible )
1601 { 1576 {
1602 gtk_window_present(GTK_WINDOW(mainwin)); 1577 gtk_window_present(GTK_WINDOW(mainwin));
1603 gtk_widget_grab_focus(mainwin); 1578 gtk_widget_grab_focus(mainwin);
1604 } 1579 }
1580 }
1581
1582 void playlistwin_show (char show)
1583 {
1584 GtkAction * a;
1585
1586 a = gtk_action_group_get_action (toggleaction_group_others, "show playlist editor");
1587
1588 if (a && gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (a)) != show)
1589 gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (a), show);
1590 else
1591 {
1592 config.playlist_visible = show;
1593 aud_cfg->playlist_visible = show;
1594
1595 if (show)
1596 playlistwin_real_show ();
1597 else
1598 playlistwin_real_hide ();
1599 }
1605 } 1600 }
1606 1601
1607 void action_playlist_track_info(void) 1602 void action_playlist_track_info(void)
1608 { 1603 {
1609 playlistwin_fileinfo(); 1604 playlistwin_fileinfo();