annotate audacious/widgets/widget.c @ 1621:fae6e0cfcc77 trunk

[svn] - Reapply r2161
author nhjm449
date Tue, 05 Sep 2006 19:57:18 -0700
parents ec4d858524fa
children
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
1556
ec4d858524fa [svn] - cleanup
nenolod
parents: 1541
diff changeset
22 #include "widgetcore.h"
1541
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 "debug.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
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
30 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
31 widget_init(Widget * widget, GdkPixmap * parent, GdkGC * gc,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
32 gint x, gint y, gint width, gint height, gint visible)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
33 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
34 widget->parent = parent;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
35 widget->gc = gc;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
36 widget_set_position(widget, x, y);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
37 widget_set_size(widget, width, height);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
38 widget->visible = visible;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
39 widget->redraw = TRUE;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
40 widget->mutex = g_mutex_new();
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
41 }
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 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
44 widget_set_position(Widget * widget, gint x, gint y)
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 widget->x = x;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
47 widget->y = y;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
48 widget_queue_redraw(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
49 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
50
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
51 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
52 widget_set_size(Widget * widget, gint width, gint height)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
53 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
54 widget->width = width;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
55 widget->height = height;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
56 widget_queue_redraw(widget);
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
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
59 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
60 widget_queue_redraw(Widget * widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
61 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
62 widget->redraw = TRUE;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
63 }
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 gboolean
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
66 widget_contains(Widget * widget, gint x, gint y)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
67 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
68 return (widget->visible &&
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
69 x >= widget->x &&
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
70 y >= widget->y &&
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
71 x < widget->x + widget->width &&
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
72 y < widget->y + widget->height);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
73 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
74
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
75 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
76 widget_show(Widget * widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
77 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
78 if (!widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
79 return;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
80
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
81 widget->visible = TRUE;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
82 widget_draw(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
83 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
84
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
85 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
86 widget_hide(Widget * widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
87 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
88 if (!widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
89 return;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
90
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
91 widget->visible = FALSE;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
92 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
93
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
94 gboolean
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
95 widget_is_visible(Widget * widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
96 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
97 if (!widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
98 return FALSE;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
99
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
100 return widget->visible;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
101 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
102
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
103 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
104 widget_resize(Widget * widget, gint width, gint height)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
105 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
106 widget_set_size(widget, width, height);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
107 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
108
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
109 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
110 widget_move(Widget * widget, gint x, gint y)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
111 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
112 widget_lock(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
113 widget_set_position(widget, x, y);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
114 widget_unlock(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
115 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
116
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
117 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
118 widget_draw(Widget * widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
119 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
120 widget_lock(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
121 WIDGET(widget)->redraw = TRUE;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
122 widget_unlock(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
123 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
124
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
125 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
126 widget_draw_quick(Widget * widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
127 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
128 widget_lock(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
129 if (WIDGET(widget)->draw != NULL)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
130 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
131 WIDGET(widget)->draw(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
132 gdk_flush();
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
133 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
134 widget_unlock(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
135 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
136
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
137 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
138 widget_list_add(GList ** list, Widget * widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
139 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
140 (*list) = g_list_append(*list, widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
141 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
142
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
143 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
144 handle_press_cb(GList * widget_list, GtkWidget * widget,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
145 GdkEventButton * event)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
146 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
147 GList *wl;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
148
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
149 for (wl = widget_list; wl; wl = g_list_next(wl)) {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
150 if (WIDGET(wl->data)->button_press_cb)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
151 WIDGET(wl->data)->button_press_cb(widget, event, wl->data);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
152 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
153 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
154
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
155 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
156 handle_release_cb(GList * widget_list, GtkWidget * widget,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
157 GdkEventButton * event)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
158 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
159 GList *wl;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
160
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
161 for (wl = widget_list; wl; wl = g_list_next(wl)) {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
162 if (WIDGET(wl->data)->button_release_cb)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
163 WIDGET(wl->data)->button_release_cb(widget, event, wl->data);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
164 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
165 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
166
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
167 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
168 handle_motion_cb(GList * widget_list, GtkWidget * widget,
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
169 GdkEventMotion * event)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
170 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
171 GList *wl;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
172
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
173 for (wl = widget_list; wl; wl = g_list_next(wl)) {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
174 if (WIDGET(wl->data)->motion_cb)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
175 WIDGET(wl->data)->motion_cb(widget, event, wl->data);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
176 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
177 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
178
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
179 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
180 handle_scroll_cb(GList * wlist, GtkWidget * widget, GdkEventScroll * event)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
181 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
182 GList *wl;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
183
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
184 for (wl = wlist; wl; wl = g_list_next(wl)) {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
185 if (WIDGET(wl->data)->mouse_scroll_cb)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
186 WIDGET(wl->data)->mouse_scroll_cb(widget, event, wl->data);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
187 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
188 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
189
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
190 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
191 widget_list_draw(GList * widget_list, gboolean * redraw, gboolean force)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
192 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
193 GList *wl;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
194 Widget *w;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
195
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
196 *redraw = FALSE;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
197 wl = widget_list;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
198
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
199 for (wl = widget_list; wl; wl = g_list_next(wl)) {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
200 w = WIDGET(wl->data);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
201
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
202 REQUIRE_LOCK(w->mutex);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
203
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
204 if (!w->draw)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
205 continue;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
206
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
207 if (!w->visible)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
208 continue;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
209
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
210 if (w->redraw || force) {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
211 w->draw(w);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
212 /* w->redraw = FALSE; */
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
213 *redraw = TRUE;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
214 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
215 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
216 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
217
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
218 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
219 widget_list_change_pixmap(GList * widget_list, GdkPixmap * pixmap)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
220 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
221 GList *wl;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
222
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
223 for (wl = widget_list; wl; wl = g_list_next(wl)) {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
224 Widget *widget = wl->data;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
225 widget->parent = pixmap;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
226 widget_queue_redraw(widget);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
227 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
228 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
229
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
230 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
231 widget_list_clear_redraw(GList * widget_list)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
232 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
233 GList *wl;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
234
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
235 for (wl = widget_list; wl; wl = g_list_next(wl)) {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
236 REQUIRE_LOCK(WIDGET(wl->data)->mutex);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
237 WIDGET(wl->data)->redraw = FALSE;
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
238 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
239 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
240
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
241 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
242 widget_lock(Widget * widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
243 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
244 g_mutex_lock(WIDGET(widget)->mutex);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
245 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
246
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
247 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
248 widget_unlock(Widget * widget)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
249 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
250 g_mutex_unlock(WIDGET(widget)->mutex);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
251 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
252
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
253 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
254 widget_list_lock(GList * widget_list)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
255 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
256 g_list_foreach(widget_list, (GFunc) widget_lock, NULL);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
257 }
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
258
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
259 void
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
260 widget_list_unlock(GList * widget_list)
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
261 {
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
262 g_list_foreach(widget_list, (GFunc) widget_unlock, NULL);
06329cbf186a [svn] this massive commit does the following:
nenolod
parents:
diff changeset
263 }