annotate audacious/widgets/number.c @ 1541:06329cbf186a trunk

[svn] this massive commit does the following: - seriously cleans up dependencies on the WA2-like gui code - moves all of the WA2 stuff into a seperate library (libwidgets.a) - makes things less icky in the player tree
author nenolod
date Wed, 09 Aug 2006 02:47:22 -0700
parents
children ec4d858524fa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1541
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
1 /* BMP - Cross-platform multimedia player
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
2 * Copyright (C) 2003-2004 BMP development team.
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
3 *
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
4 * Based on XMMS:
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
5 * Copyright (C) 1998-2003 XMMS development team.
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
6 *
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
10 * (at your option) any later version.
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
11 *
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
16 *
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
20 */
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
21
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
22 #include "number.h"
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
23
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
24 #include <glib.h>
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
25 #include <gdk/gdk.h>
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
26
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
27 #include "skin.h"
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
28
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
29 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
30 number_set_number(Number * nu,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
31 gint number)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
32 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
33 if (number == nu->nu_number)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
34 return;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
35
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
36 nu->nu_number = number;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
37 widget_draw(WIDGET(nu));
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
38 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
39
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
40 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
41 number_draw(Widget * w)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
42 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
43 Number *nu = NUMBER(w);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
44 GdkPixmap *obj;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
45
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
46 obj = nu->nu_widget.parent;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
47
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
48 if (nu->nu_number <= 11)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
49 skin_draw_pixmap(bmp_active_skin, obj, nu->nu_widget.gc,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
50 nu->nu_skin_index, nu->nu_number * 9, 0,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
51 nu->nu_widget.x, nu->nu_widget.y, 9, 13);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
52 else
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
53 skin_draw_pixmap(bmp_active_skin, obj, nu->nu_widget.gc,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
54 nu->nu_skin_index, 90, 0, nu->nu_widget.x,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
55 nu->nu_widget.y, 9, 13);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
56 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
57
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
58 Number *
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
59 create_number(GList ** wlist,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
60 GdkPixmap * parent,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
61 GdkGC * gc,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
62 gint x, gint y,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
63 SkinPixmapId si)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
64 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
65 Number *nu;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
66
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
67 nu = g_new0(Number, 1);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
68 widget_init(&nu->nu_widget, parent, gc, x, y, 9, 13, 1);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
69 nu->nu_widget.draw = number_draw;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
70 nu->nu_number = 10;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
71 nu->nu_skin_index = si;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
72
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
73 widget_list_add(wlist, WIDGET(nu));
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
74 return nu;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
75 }