Mercurial > audlegacy
comparison src/audacious/ui_main.c @ 2843:91ef09fe7936 trunk
UiSkinnedButton can now work as TButton
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Sun, 17 Jun 2007 15:53:59 +0200 |
parents | c2622a939e9e |
children | 22da7cd0eca0 |
comparison
equal
deleted
inserted
replaced
2842:c2622a939e9e | 2843:91ef09fe7936 |
---|---|
131 | 131 |
132 static GtkWidget *mainwin_rew, *mainwin_fwd; | 132 static GtkWidget *mainwin_rew, *mainwin_fwd; |
133 static GtkWidget *mainwin_eject; | 133 static GtkWidget *mainwin_eject; |
134 static GtkWidget *mainwin_play, *mainwin_pause, *mainwin_stop; | 134 static GtkWidget *mainwin_play, *mainwin_pause, *mainwin_stop; |
135 | 135 |
136 TButton *mainwin_shuffle, *mainwin_repeat, *mainwin_eq, *mainwin_pl; | 136 static GtkWidget *mainwin_shuffle, *mainwin_repeat, *mainwin_eq, *mainwin_pl; |
137 | |
137 TextBox *mainwin_info; | 138 TextBox *mainwin_info; |
138 TextBox *mainwin_stime_min, *mainwin_stime_sec; | 139 TextBox *mainwin_stime_min, *mainwin_stime_sec; |
139 | 140 |
140 static TextBox *mainwin_rate_text, *mainwin_freq_text, | 141 static TextBox *mainwin_rate_text, *mainwin_freq_text, |
141 *mainwin_othertext; | 142 *mainwin_othertext; |
182 | 183 |
183 void mainwin_position_motion_cb(gint pos); | 184 void mainwin_position_motion_cb(gint pos); |
184 void mainwin_position_release_cb(gint pos); | 185 void mainwin_position_release_cb(gint pos); |
185 | 186 |
186 void set_doublesize(gboolean doublesize); | 187 void set_doublesize(gboolean doublesize); |
187 | 188 void mainwin_eq_pushed(gboolean toggled); |
189 void mainwin_pl_pushed(gboolean toggled); | |
188 | 190 |
189 | 191 |
190 /* FIXME: placed here for now */ | 192 /* FIXME: placed here for now */ |
191 void | 193 void |
192 playback_get_sample_params(gint * bitrate, | 194 playback_get_sample_params(gint * bitrate, |
738 if (bmp_active_skin->properties.mainwin_eject_x && bmp_active_skin->properties.mainwin_eject_y) | 740 if (bmp_active_skin->properties.mainwin_eject_x && bmp_active_skin->properties.mainwin_eject_y) |
739 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_eject), bmp_active_skin->properties.mainwin_eject_x, | 741 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_eject), bmp_active_skin->properties.mainwin_eject_x, |
740 bmp_active_skin->properties.mainwin_eject_y); | 742 bmp_active_skin->properties.mainwin_eject_y); |
741 | 743 |
742 if (bmp_active_skin->properties.mainwin_eqbutton_x && bmp_active_skin->properties.mainwin_eqbutton_y) | 744 if (bmp_active_skin->properties.mainwin_eqbutton_x && bmp_active_skin->properties.mainwin_eqbutton_y) |
743 widget_move(WIDGET(mainwin_eq), bmp_active_skin->properties.mainwin_eqbutton_x, | 745 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_eq), bmp_active_skin->properties.mainwin_eqbutton_x, |
744 bmp_active_skin->properties.mainwin_eqbutton_y); | 746 bmp_active_skin->properties.mainwin_eqbutton_y); |
745 | 747 |
746 if (bmp_active_skin->properties.mainwin_plbutton_x && bmp_active_skin->properties.mainwin_plbutton_y) | 748 if (bmp_active_skin->properties.mainwin_plbutton_x && bmp_active_skin->properties.mainwin_plbutton_y) |
747 widget_move(WIDGET(mainwin_pl), bmp_active_skin->properties.mainwin_plbutton_x, | 749 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_pl), bmp_active_skin->properties.mainwin_plbutton_x, |
748 bmp_active_skin->properties.mainwin_plbutton_y); | 750 bmp_active_skin->properties.mainwin_plbutton_y); |
749 | 751 |
750 if (bmp_active_skin->properties.mainwin_shuffle_x && bmp_active_skin->properties.mainwin_shuffle_y) | 752 if (bmp_active_skin->properties.mainwin_shuffle_x && bmp_active_skin->properties.mainwin_shuffle_y) |
751 widget_move(WIDGET(mainwin_shuffle), bmp_active_skin->properties.mainwin_shuffle_x, | 753 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_shuffle), bmp_active_skin->properties.mainwin_shuffle_x, |
752 bmp_active_skin->properties.mainwin_shuffle_y); | 754 bmp_active_skin->properties.mainwin_shuffle_y); |
753 | 755 |
754 if (bmp_active_skin->properties.mainwin_repeat_x && bmp_active_skin->properties.mainwin_repeat_y) | 756 if (bmp_active_skin->properties.mainwin_repeat_x && bmp_active_skin->properties.mainwin_repeat_y) |
755 widget_move(WIDGET(mainwin_repeat), bmp_active_skin->properties.mainwin_repeat_x, | 757 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_repeat), bmp_active_skin->properties.mainwin_repeat_x, |
756 bmp_active_skin->properties.mainwin_repeat_y); | 758 bmp_active_skin->properties.mainwin_repeat_y); |
757 | 759 |
758 if (bmp_active_skin->properties.mainwin_about_x && bmp_active_skin->properties.mainwin_about_y) | 760 if (bmp_active_skin->properties.mainwin_about_x && bmp_active_skin->properties.mainwin_about_y) |
759 widget_move(WIDGET(mainwin_about), bmp_active_skin->properties.mainwin_about_x, | 761 widget_move(WIDGET(mainwin_about), bmp_active_skin->properties.mainwin_about_x, |
760 bmp_active_skin->properties.mainwin_about_y); | 762 bmp_active_skin->properties.mainwin_about_y); |
1676 mainwin_shuffle_pushed(gboolean toggled) | 1678 mainwin_shuffle_pushed(gboolean toggled) |
1677 { | 1679 { |
1678 check_set( toggleaction_group_others , "playback shuffle" , toggled ); | 1680 check_set( toggleaction_group_others , "playback shuffle" , toggled ); |
1679 } | 1681 } |
1680 | 1682 |
1683 void mainwin_shuffle_pushed_cb(void) { | |
1684 mainwin_shuffle_pushed(UI_SKINNED_BUTTON(mainwin_shuffle)->inside); | |
1685 } | |
1686 | |
1681 void | 1687 void |
1682 mainwin_repeat_pushed(gboolean toggled) | 1688 mainwin_repeat_pushed(gboolean toggled) |
1683 { | 1689 { |
1684 check_set( toggleaction_group_others , "playback repeat" , toggled ); | 1690 check_set( toggleaction_group_others , "playback repeat" , toggled ); |
1691 } | |
1692 | |
1693 void mainwin_repeat_pushed_cb(void) { | |
1694 mainwin_repeat_pushed(UI_SKINNED_BUTTON(mainwin_repeat)->inside); | |
1695 } | |
1696 | |
1697 void mainwin_equalizer_pushed_cb(void) { | |
1698 mainwin_eq_pushed(UI_SKINNED_BUTTON(mainwin_eq)->inside); | |
1699 } | |
1700 | |
1701 void mainwin_playlist_pushed_cb(void) { | |
1702 mainwin_pl_pushed(UI_SKINNED_BUTTON(mainwin_pl)->inside); | |
1703 } | |
1704 | |
1705 void | |
1706 mainwin_eq_pushed(gboolean toggled) | |
1707 { | |
1708 equalizerwin_show(toggled); | |
1685 } | 1709 } |
1686 | 1710 |
1687 void | 1711 void |
1688 mainwin_pl_pushed(gboolean toggled) | 1712 mainwin_pl_pushed(gboolean toggled) |
1689 { | 1713 { |
2759 7, mainwin_playlist_next); | 2783 7, mainwin_playlist_next); |
2760 mainwin_seject = | 2784 mainwin_seject = |
2761 create_sbutton(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 216, 4, 9, | 2785 create_sbutton(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 216, 4, 9, |
2762 7, mainwin_eject_pushed); | 2786 7, mainwin_eject_pushed); |
2763 | 2787 |
2764 mainwin_shuffle = | 2788 mainwin_shuffle = ui_skinned_button_new(); |
2765 create_tbutton(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 164, 89, 46, | 2789 ui_skinned_toggle_button_setup(mainwin_shuffle, SKINNED_WINDOW(mainwin)->fixed, mainwin_bg, |
2766 15, 28, 0, 28, 15, 28, 30, 28, 45, | 2790 SKINNED_WINDOW(mainwin)->gc, 164, 89, 46, |
2767 mainwin_shuffle_pushed, SKIN_SHUFREP); | 2791 15, 28, 0, 28, 15, 28, 30, 28, 45, SKIN_SHUFREP); |
2768 | 2792 g_signal_connect(mainwin_shuffle, "clicked", mainwin_shuffle_pushed_cb, NULL); |
2769 mainwin_repeat = | 2793 |
2770 create_tbutton(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 210, 89, 28, | 2794 mainwin_repeat = ui_skinned_button_new(); |
2771 15, 0, 0, 0, 15, 0, 30, 0, 45, | 2795 ui_skinned_toggle_button_setup(mainwin_repeat, SKINNED_WINDOW(mainwin)->fixed, mainwin_bg, |
2772 mainwin_repeat_pushed, SKIN_SHUFREP); | 2796 SKINNED_WINDOW(mainwin)->gc, 210, 89, 28, |
2773 | 2797 15, 0, 0, 0, 15, 0, 30, 0, 45, SKIN_SHUFREP); |
2774 mainwin_eq = | 2798 g_signal_connect(mainwin_repeat, "clicked", mainwin_repeat_pushed_cb, NULL); |
2775 create_tbutton(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 219, 58, 23, | 2799 |
2776 12, 0, 61, 46, 61, 0, 73, 46, 73, equalizerwin_show, | 2800 mainwin_eq = ui_skinned_button_new(); |
2777 SKIN_SHUFREP); | 2801 ui_skinned_toggle_button_setup(mainwin_eq, SKINNED_WINDOW(mainwin)->fixed, mainwin_bg, |
2778 tbutton_set_toggled(mainwin_eq, cfg.equalizer_visible); | 2802 SKINNED_WINDOW(mainwin)->gc, 219, 58, 23, |
2779 mainwin_pl = | 2803 12, 0, 61, 46, 61, 0, 73, 46, 73, SKIN_SHUFREP); |
2780 create_tbutton(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 242, 58, 23, | 2804 g_signal_connect(mainwin_eq, "clicked", mainwin_equalizer_pushed_cb, NULL); |
2781 12, 23, 61, 69, 61, 23, 73, 69, 73, | 2805 UI_SKINNED_BUTTON(mainwin_eq)->inside = cfg.equalizer_visible; |
2782 mainwin_pl_pushed, SKIN_SHUFREP); | 2806 |
2783 tbutton_set_toggled(mainwin_pl, cfg.playlist_visible); | 2807 mainwin_pl = ui_skinned_button_new(); |
2808 ui_skinned_toggle_button_setup(mainwin_pl, SKINNED_WINDOW(mainwin)->fixed, mainwin_bg, | |
2809 SKINNED_WINDOW(mainwin)->gc, 242, 58, 23, | |
2810 12, 23, 61, 69, 61, 23, 73, 69, 73, SKIN_SHUFREP); | |
2811 g_signal_connect(mainwin_pl, "clicked", mainwin_playlist_pushed_cb, NULL); | |
2812 UI_SKINNED_BUTTON(mainwin_pl)->inside = cfg.playlist_visible; | |
2784 | 2813 |
2785 mainwin_info = | 2814 mainwin_info = |
2786 create_textbox(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 112, 27, | 2815 create_textbox(&mainwin_wlist, mainwin_bg, SKINNED_WINDOW(mainwin)->gc, 112, 27, |
2787 153, 1, SKIN_TEXT); | 2816 153, 1, SKIN_TEXT); |
2788 textbox_set_scroll(mainwin_info, cfg.autoscroll); | 2817 textbox_set_scroll(mainwin_info, cfg.autoscroll); |
2908 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_splay)); | 2937 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_splay)); |
2909 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_spause)); | 2938 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_spause)); |
2910 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_sstop)); | 2939 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_sstop)); |
2911 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_sfwd)); | 2940 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_sfwd)); |
2912 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_seject)); | 2941 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_seject)); |
2913 | |
2914 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_shuffle)); | |
2915 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_repeat)); | |
2916 | |
2917 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_eq)); | |
2918 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_pl)); | |
2919 | 2942 |
2920 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_info)); | 2943 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_info)); |
2921 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_othertext)); | 2944 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_othertext)); |
2922 | 2945 |
2923 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_rate_text)); | 2946 ui_skinned_window_widgetlist_associate(mainwin, WIDGET(mainwin_rate_text)); |
3234 | 3257 |
3235 void | 3258 void |
3236 action_playback_repeat( GtkToggleAction * action ) | 3259 action_playback_repeat( GtkToggleAction * action ) |
3237 { | 3260 { |
3238 cfg.repeat = gtk_toggle_action_get_active( action ); | 3261 cfg.repeat = gtk_toggle_action_get_active( action ); |
3239 tbutton_set_toggled(mainwin_repeat, cfg.repeat); | 3262 UI_SKINNED_BUTTON(mainwin_repeat)->inside = cfg.repeat; |
3240 } | 3263 } |
3241 | 3264 |
3242 void | 3265 void |
3243 action_playback_shuffle( GtkToggleAction * action ) | 3266 action_playback_shuffle( GtkToggleAction * action ) |
3244 { | 3267 { |
3245 cfg.shuffle = gtk_toggle_action_get_active( action ); | 3268 cfg.shuffle = gtk_toggle_action_get_active( action ); |
3246 playlist_set_shuffle(cfg.shuffle); | 3269 playlist_set_shuffle(cfg.shuffle); |
3247 tbutton_set_toggled(mainwin_shuffle, cfg.shuffle); | 3270 UI_SKINNED_BUTTON(mainwin_shuffle)->inside = cfg.shuffle; |
3248 } | 3271 } |
3249 | 3272 |
3250 void | 3273 void |
3251 action_stop_after_current_song( GtkToggleAction * action ) | 3274 action_stop_after_current_song( GtkToggleAction * action ) |
3252 { | 3275 { |