Mercurial > audlegacy
annotate audacious/playstatus.c @ 487:a2478a8475ee trunk
[svn] Remove X11 dependency. Audacious can now run anywhere where GTK is
available. Please port me to your favourite operating system.
author | nenolod |
---|---|
date | Mon, 23 Jan 2006 14:11:40 -0800 |
parents | 0ee0b9b6db7e |
children | 3b990c26fc46 |
rev | line source |
---|---|
0 | 1 /* XMMS - Cross-platform multimedia player |
2 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies | |
3 * | |
4 * This program is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
15 * along with this program; if not, write to the Free Software | |
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
17 */ | |
18 | |
19 #include "playstatus.h" | |
20 | |
21 #include <glib.h> | |
22 #include <gdk/gdk.h> | |
23 | |
24 #include "skin.h" | |
25 #include "widget.h" | |
26 | |
27 void | |
28 playstatus_draw(Widget * w) | |
29 { | |
30 PlayStatus *ps = PLAY_STATUS(w); | |
31 GdkPixmap *obj; | |
32 | |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
33 if (!w) |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
34 return; |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
35 |
0 | 36 obj = ps->ps_widget.parent; |
37 | |
38 if (ps->ps_status == STATUS_PLAY) | |
39 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
40 SKIN_PLAYPAUSE, 36, 0, ps->ps_widget.x, | |
41 ps->ps_widget.y, 3, 9); | |
42 else | |
43 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
44 SKIN_PLAYPAUSE, 27, 0, ps->ps_widget.x, | |
45 ps->ps_widget.y, 2, 9); | |
46 switch (ps->ps_status) { | |
47 case STATUS_STOP: | |
48 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
49 SKIN_PLAYPAUSE, 18, 0, | |
50 ps->ps_widget.x + 2, ps->ps_widget.y, 9, 9); | |
51 break; | |
52 case STATUS_PAUSE: | |
53 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
54 SKIN_PLAYPAUSE, 9, 0, | |
55 ps->ps_widget.x + 2, ps->ps_widget.y, 9, 9); | |
56 break; | |
57 case STATUS_PLAY: | |
58 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
59 SKIN_PLAYPAUSE, 1, 0, | |
60 ps->ps_widget.x + 3, ps->ps_widget.y, 8, 9); | |
61 break; | |
62 } | |
63 } | |
64 | |
65 void | |
66 playstatus_set_status(PlayStatus * ps, PStatus status) | |
67 { | |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
68 if (!ps) |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
69 return; |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
70 |
0 | 71 ps->ps_status = status; |
72 widget_draw(WIDGET(ps)); | |
73 } | |
74 | |
75 PlayStatus * | |
76 create_playstatus(GList ** wlist, GdkPixmap * parent, | |
77 GdkGC * gc, gint x, gint y) | |
78 { | |
79 PlayStatus *ps; | |
80 | |
81 ps = g_new0(PlayStatus, 1); | |
82 widget_init(&ps->ps_widget, parent, gc, x, y, 11, 9, TRUE); | |
83 ps->ps_widget.draw = playstatus_draw; | |
84 | |
85 widget_list_add(wlist, WIDGET(ps)); | |
86 return ps; | |
87 } |