Mercurial > audlegacy
changeset 3220:9af29d8ccb61 trunk
remove dead files
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Thu, 02 Aug 2007 15:07:31 +0200 |
parents | 2f08ee945857 |
children | 9583cd62231f |
files | src/audacious/widgets/playlist_slider.c src/audacious/widgets/playlist_slider.h |
diffstat | 2 files changed, 0 insertions(+), 232 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/widgets/playlist_slider.c Thu Aug 02 15:05:46 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -/* Audacious - * Copyright (C) 2005-2007 Audacious development team. - * - * BMP - Cross-platform multimedia player - * Copyright (C) 2003-2004 BMP development team. - * - * Based on XMMS: - * Copyright (C) 1998-2003 XMMS development team. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; under version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses>. - * - * The Audacious team does not consider modular code linking to - * Audacious or using our public API to be a derived work. - */ - -#include "widgetcore.h" - -#include <glib.h> - -#include "playlist.h" -#include "ui_playlist.h" -#include "skin.h" -#include "widget.h" - -extern GCond *cond_scan; - -void -playlistslider_draw(Widget * w) -{ - PlaylistSlider *ps = (PlaylistSlider *) w; - GdkPixmap *obj; - gint y, skinx; - Playlist *playlist = playlist_get_active(); - - g_return_if_fail(ps != NULL); - g_return_if_fail(ps->ps_list != NULL); - - if (playlist_get_length(playlist) > ps->ps_list->pl_num_visible) - y = (ps->ps_list->pl_first * (ps->ps_widget.height - 19)) / - (playlist_get_length(playlist) - ps->ps_list->pl_num_visible); - else - y = 0; - - obj = ps->ps_widget.parent; - - if (ps->ps_back_image) { - if (skin_get_id() != ps->ps_skin_id) - ps->ps_skin_id = skin_get_id(); - else if (ps->ps_widget.height == ps->ps_prev_height) - gdk_draw_image(obj, ps->ps_widget.gc, - ps->ps_back_image, 0, 0, - ps->ps_widget.x, - ps->ps_widget.y + ps->ps_prev_y, 8, 18); - g_object_unref(ps->ps_back_image); - } - - ps->ps_prev_y = y; - ps->ps_prev_height = ps->ps_widget.height; - ps->ps_back_image = gdk_drawable_get_image(obj, ps->ps_widget.x, - ps->ps_widget.y + y, 8, 18); - if (ps->ps_is_draging) - skinx = 61; - else - skinx = 52; - - skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, SKIN_PLEDIT, - skinx, 53, ps->ps_widget.x, ps->ps_widget.y + y, 8, 18); -} - -static void -playlistslider_set_pos(PlaylistSlider * ps, gint y) -{ - gint pos; - Playlist *playlist = playlist_get_active(); - - y = CLAMP(y, 0, ps->ps_widget.height - 19); - - pos = (y * (playlist_get_length(playlist) - ps->ps_list->pl_num_visible)) / - (ps->ps_widget.height - 19); - playlistwin_set_toprow(pos); -} - -void -playlistslider_button_press_cb(GtkWidget * widget, - GdkEventButton * event, PlaylistSlider * ps) -{ - gint y = event->y - ps->ps_widget.y; - - if (!widget_contains(&ps->ps_widget, event->x, event->y)) - return; - - if (event->button != 1 && event->button != 2) - return; - - if ((y >= ps->ps_prev_y && y < ps->ps_prev_y + 18)) { - ps->ps_is_draging |= event->button; - ps->ps_drag_y = y - ps->ps_prev_y; - widget_draw(WIDGET(ps)); - } - else if (event->button == 2) { - playlistslider_set_pos(ps, y); - ps->ps_is_draging |= event->button; - ps->ps_drag_y = 0; - widget_draw(WIDGET(ps)); - } - else { - gint n = ps->ps_list->pl_num_visible / 2; - if (y < ps->ps_prev_y) - n *= -1; - playlistwin_scroll(n); - } - g_cond_signal(cond_scan); -} - -void -playlistslider_button_release_cb(GtkWidget * widget, - GdkEventButton * event, - PlaylistSlider * ps) -{ - if (ps->ps_is_draging) { - ps->ps_is_draging &= ~event->button; - widget_draw(WIDGET(ps)); - } -} - -void -playlistslider_motion_cb(GtkWidget * widget, GdkEventMotion * event, - PlaylistSlider * ps) -{ - gint y; - - if (!ps->ps_is_draging) - return; - - y = event->y - ps->ps_widget.y - ps->ps_drag_y; - playlistslider_set_pos(ps, y); - g_cond_signal(cond_scan); -} - -PlaylistSlider * -create_playlistslider(GList ** wlist, GdkPixmap * parent, - GdkGC * gc, gint x, gint y, gint h, - PlayList_List * list) -{ - PlaylistSlider *ps; - - ps = g_new0(PlaylistSlider, 1); - widget_init(&ps->ps_widget, parent, gc, x, y, 8, h, 1); - - ps->ps_widget.button_press_cb = - (void (*)(GtkWidget *, GdkEventButton *, gpointer)) - playlistslider_button_press_cb; - - ps->ps_widget.button_release_cb = - (void (*)(GtkWidget *, GdkEventButton *, gpointer)) - playlistslider_button_release_cb; - - ps->ps_widget.motion_cb = - (void (*)(GtkWidget *, GdkEventMotion *, gpointer)) - playlistslider_motion_cb; - - ps->ps_widget.draw = playlistslider_draw; - ps->ps_list = list; - - widget_list_add(wlist, WIDGET(ps)); - return ps; -}
--- a/src/audacious/widgets/playlist_slider.h Thu Aug 02 15:05:46 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* Audacious - * Copyright (C) 2005-2007 Audacious development team. - * - * BMP - Cross-platform multimedia player - * Copyright (C) 2003-2004 BMP development team. - * - * Based on XMMS: - * Copyright (C) 1998-2003 XMMS development team. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; under version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses>. - * - * The Audacious team does not consider modular code linking to - * Audacious or using our public API to be a derived work. - */ - -#ifndef _WIDGETCORE_H_ -#error Please do not include me directly! Use widgetcore.h instead! -#endif - -#ifndef PLAYLIST_SLIDER_H -#define PLAYLIST_SLIDER_H - -#include <glib.h> -#include <gdk/gdk.h> - -#include "playlist_list.h" -#include "widget.h" - -#define PLAYLIST_SLIDER(x) ((PlayerlistSlider *)(x)) -struct _PlaylistSlider { - Widget ps_widget; - PlayList_List *ps_list; - gboolean ps_is_draging; - gint ps_drag_y, ps_prev_y, ps_prev_height; - GdkImage *ps_back_image; - gint ps_skin_id; -}; - -typedef struct _PlaylistSlider PlaylistSlider; - -PlaylistSlider *create_playlistslider(GList ** wlist, GdkPixmap * parent, - GdkGC * gc, gint x, gint y, gint h, - PlayList_List * list); - -#endif