annotate src/skins/ui_dock.c @ 2572:d0daee216c8d

stub (really incomplete) for skin engine plugin
author Tomasz Mon <desowin@gmail.com>
date Sun, 18 May 2008 14:20:51 +0200
parents
children 294232665cb0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2572
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
1 /* Audacious - Cross-platform multimedia player
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
2 * Copyright (C) 2005-2007 Audacious development team
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
3 *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
4 * Based on BMP:
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2003-2004 BMP development team.
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
6 *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
7 * Based on XMMS:
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
8 * Copyright (C) 1998-2003 XMMS development team.
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
9 *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
12 * the Free Software Foundation; under version 3 of the License.
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
13 *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
17 * GNU General Public License for more details.
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
18 *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses>.
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
21 *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
22 * The Audacious team does not consider modular code linking to
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
23 * Audacious or using our public API to be a derived work.
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
24 */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
25
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
26 #include "ui_dock.h"
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
27
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
28 #include <gdk/gdk.h>
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
29 #include <stdlib.h>
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
30 #include <audacious/plugin.h>
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
31 #include "ui_skinned_window.h"
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
32
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
33 #include "platform/smartinclude.h"
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
34
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
35 static GList *dock_window_list = NULL;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
36
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
37 struct _DockedWindow {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
38 GtkWindow *w;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
39 gint offset_x, offset_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
40 };
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
41
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
42 typedef struct _DockedWindow DockedWindow;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
43
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
44
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
45 static gint
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
46 docked_list_compare(DockedWindow * a, DockedWindow * b)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
47 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
48 if (a->w == b->w)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
49 return 0;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
50 return 1;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
51 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
52
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
53 static void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
54 snap_edge(gint * x, gint * y, gint w, gint h, gint bx, gint by,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
55 gint bw, gint bh)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
56 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
57 gint sd = aud_cfg->snap_distance;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
58
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
59 if ((*x + w > bx - sd) && (*x + w < bx + sd) &&
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
60 (*y > by - h - sd) && (*y < by + bh + sd)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
61 *x = bx - w;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
62 if ((*y > by - sd) && (*y < by + sd))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
63 *y = by;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
64 if ((*y + h > by + bh - sd) && (*y + h < by + bh + sd))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
65 *y = by + bh - h;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
66 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
67 if ((*x > bx + bw - sd) && (*x < bx + bw + sd) &&
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
68 (*y > by - h - sd) && (*y < by + bh + sd)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
69 *x = bx + bw;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
70 if ((*y > by - sd) && (*y < by + sd))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
71 *y = by;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
72 if ((*y + h > by + bh - sd) && (*y + h < by + bh + sd))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
73 *y = by + bh - h;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
74 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
75 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
76
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
77 static void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
78 snap(gint * x, gint * y, gint w, gint h, gint bx, gint by, gint bw, gint bh)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
79 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
80 snap_edge(x, y, w, h, bx, by, bw, bh);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
81 snap_edge(y, x, h, w, by, bx, bh, bw);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
82 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
83
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
84 static void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
85 calc_snap_offset(GList * dlist, GList * wlist, gint x, gint y,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
86 gint * off_x, gint * off_y)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
87 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
88 gint nx, ny, nw, nh, sx, sy, sw, sh;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
89 GtkWindow *w;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
90 GList *dnode, *wnode;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
91 DockedWindow temp, *dw;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
92
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
93
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
94 *off_x = 0;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
95 *off_y = 0;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
96
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
97 if (!aud_cfg->snap_windows)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
98 return;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
99
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
100 /*
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
101 * FIXME: Why not break out of the loop when we find someting
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
102 * to snap to?
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
103 */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
104 for (dnode = dlist; dnode; dnode = g_list_next(dnode)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
105 dw = dnode->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
106 gtk_window_get_size(dw->w, &nw, &nh);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
107
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
108 nx = dw->offset_x + *off_x + x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
109 ny = dw->offset_y + *off_y + y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
110
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
111 /* Snap to screen edges */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
112 if (abs(nx) < aud_cfg->snap_distance)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
113 *off_x -= nx;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
114 if (abs(ny) < aud_cfg->snap_distance)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
115 *off_y -= ny;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
116 if (abs(nx + nw - gdk_screen_width()) < aud_cfg->snap_distance)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
117 *off_x -= nx + nw - gdk_screen_width();
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
118 if (abs(ny + nh - gdk_screen_height()) < aud_cfg->snap_distance)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
119 *off_y -= ny + nh - gdk_screen_height();
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
120
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
121 /* Snap to other windows */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
122 for (wnode = wlist; wnode; wnode = g_list_next(wnode)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
123 temp.w = wnode->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
124 if (g_list_find_custom
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
125 (dlist, &temp, (GCompareFunc) docked_list_compare))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
126 /* These windows are already docked */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
127 continue;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
128
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
129 w = GTK_WINDOW(wnode->data);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
130 gtk_window_get_position(w, &sx, &sy);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
131 gtk_window_get_size(w, &sw, &sh);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
132
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
133 nx = dw->offset_x + *off_x + x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
134 ny = dw->offset_y + *off_y + y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
135
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
136 snap(&nx, &ny, nw, nh, sx, sy, sw, sh);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
137
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
138 *off_x += nx - (dw->offset_x + *off_x + x);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
139 *off_y += ny - (dw->offset_y + *off_y + y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
140 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
141 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
142 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
143
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
144
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
145 static gboolean
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
146 is_docked(gint a_x, gint a_y, gint a_w, gint a_h,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
147 gint b_x, gint b_y, gint b_w, gint b_h)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
148 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
149 if (((a_x == b_x + b_w) || (a_x + a_w == b_x)) &&
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
150 (b_y + b_h >= a_y) && (b_y <= a_y + a_h))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
151 return TRUE;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
152
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
153 if (((a_y == b_y + b_h) || (a_y + a_h == b_y)) &&
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
154 (b_x >= a_x - b_w) && (b_x <= a_x + a_w))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
155 return TRUE;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
156
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
157 return FALSE;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
158 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
159
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
160 /*
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
161 * Builds a list of all windows that are docked to the window "w".
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
162 * Recursively adds all windows that are docked to the windows that are
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
163 * docked to "w" and so on...
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
164 * FIXME: init_off_? ?
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
165 */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
166
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
167 static GList *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
168 get_docked_list(GList * dlist, GList * wlist, GtkWindow * w,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
169 gint init_off_x, gint init_off_y)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
170 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
171 GList *node;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
172 DockedWindow *dwin, temp;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
173 gint w_x, w_y, w_width, w_height;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
174 gint t_x, t_y, t_width, t_height;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
175
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
176
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
177 gtk_window_get_position(w, &w_x, &w_y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
178 gtk_window_get_size(w, &w_width, &w_height);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
179 if (!dlist) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
180 dwin = g_new0(DockedWindow, 1);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
181 dwin->w = w;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
182 dlist = g_list_append(dlist, dwin);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
183 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
184
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
185 for (node = wlist; node; node = g_list_next(node)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
186 temp.w = node->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
187 if (g_list_find_custom
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
188 (dlist, &temp, (GCompareFunc) docked_list_compare))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
189 continue;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
190
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
191 gtk_window_get_position(GTK_WINDOW(node->data), &t_x, &t_y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
192 gtk_window_get_size(GTK_WINDOW(node->data), &t_width, &t_height);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
193 if (is_docked
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
194 (w_x, w_y, w_width, w_height, t_x, t_y, t_width, t_height)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
195 dwin = g_new0(DockedWindow, 1);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
196 dwin->w = node->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
197
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
198 dwin->offset_x = t_x - w_x + init_off_x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
199 dwin->offset_y = t_y - w_y + init_off_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
200
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
201 dlist = g_list_append(dlist, dwin);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
202
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
203 dlist =
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
204 get_docked_list(dlist, wlist, dwin->w, dwin->offset_x,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
205 dwin->offset_y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
206 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
207 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
208 return dlist;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
209 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
210
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
211 static void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
212 free_docked_list(GList * dlist)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
213 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
214 GList *node;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
215
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
216 for (node = dlist; node; node = g_list_next(node))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
217 g_free(node->data);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
218 g_list_free(dlist);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
219 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
220
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
221 static void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
222 docked_list_move(GList * list, gint x, gint y)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
223 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
224 GList *node;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
225 DockedWindow *dw;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
226
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
227 for (node = list; node; node = g_list_next(node)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
228 dw = node->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
229 gtk_window_move(dw->w, x + dw->offset_x, y + dw->offset_y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
230
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
231 SkinnedWindow *window = SKINNED_WINDOW(dw->w);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
232 if (window) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
233 switch(window->type) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
234
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
235 case WINDOW_MAIN:
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
236 aud_cfg->player_x = x + dw->offset_x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
237 aud_cfg->player_y = y + dw->offset_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
238 break;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
239 case WINDOW_EQ:
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
240 aud_cfg->equalizer_x = x + dw->offset_x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
241 aud_cfg->equalizer_y = y + dw->offset_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
242 break;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
243 case WINDOW_PLAYLIST:
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
244 aud_cfg->playlist_x = x + dw->offset_x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
245 aud_cfg->playlist_y = y + dw->offset_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
246 break;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
247 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
248
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
249 window->x = x + dw->offset_x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
250 window->y = y + dw->offset_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
251 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
252 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
253 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
254
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
255 static GList *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
256 shade_move_list(GList * list, GtkWindow * widget, gint offset)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
257 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
258 gint x, y, w, h;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
259 GList *node;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
260 DockedWindow *dw;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
261
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
262 gtk_window_get_position(widget, &x, &y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
263 gtk_window_get_size(widget, &w, &h);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
264
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
265
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
266 for (node = list; node;) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
267 gint dx, dy, dwidth, dheight;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
268
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
269 dw = node->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
270 gtk_window_get_position(dw->w, &dx, &dy);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
271 gtk_window_get_size(dw->w, &dwidth, &dheight);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
272 if (is_docked(x, y, w, h, dx, dy, dwidth, dheight) &&
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
273 ((dx + dwidth) > x && dx < (x + w))) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
274 list = g_list_remove_link(list, node);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
275 g_list_free_1(node);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
276
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
277 node = list = shade_move_list(list, dw->w, offset);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
278 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
279 else
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
280 node = g_list_next(node);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
281 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
282 gtk_window_move(widget, x, y + offset);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
283 return list;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
284 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
285
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
286 /*
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
287 * Builds a list of the windows in the list of DockedWindows "winlist"
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
288 * that are docked to the top or bottom of the window, and recursively
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
289 * adds all windows that are docked to the top or bottom of that window,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
290 * and so on...
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
291 * Note: The data in "winlist" is not copied.
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
292 */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
293 static GList *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
294 find_shade_list(GtkWindow * widget, GList * winlist, GList * shade_list)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
295 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
296 gint x, y, w, h;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
297 gint dx, dy, dwidth, dheight;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
298 GList *node;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
299
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
300 gtk_window_get_position(widget, &x, &y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
301 gtk_window_get_size(widget, &w, &h);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
302 for (node = winlist; node; node = g_list_next(node)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
303 DockedWindow *dw = node->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
304 if (g_list_find_custom
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
305 (shade_list, dw, (GCompareFunc) docked_list_compare))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
306 continue;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
307 gtk_window_get_position(dw->w, &dx, &dy);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
308 gtk_window_get_size(dw->w, &dwidth, &dheight);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
309
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
310 /* FIXME. Is the is_docked() necessary? */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
311 if (is_docked(x, y, w, h, dx, dy, dwidth, dheight) &&
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
312 ((dx + dwidth) > x && dx < (x + w))) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
313 shade_list = g_list_append(shade_list, dw);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
314 shade_list = find_shade_list(dw->w, winlist, shade_list);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
315 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
316 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
317 return shade_list;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
318 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
319
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
320 void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
321 dock_window_resize(GtkWindow * widget, gint new_w, gint new_h, gint w, gint h)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
322 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
323 gdk_window_set_hints(GTK_WIDGET(widget)->window, 0, 0, MIN(w, new_w),
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
324 MIN(h, new_h), MAX(w, new_w), MAX(h, new_h),
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
325 GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
326 gdk_window_resize(GTK_WIDGET(widget)->window, new_w, new_h);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
327 gdk_window_set_hints(GTK_WIDGET(widget)->window, 0, 0, new_w, new_h,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
328 new_w, new_h, GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
329 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
330
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
331 void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
332 dock_shade(GList * window_list, GtkWindow * widget, gint new_h)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
333 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
334 gint x, y, w, h, off_y, orig_off_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
335 GList *node, *docked_list, *slist;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
336 DockedWindow *dw;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
337
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
338 gtk_window_get_position(widget, &x, &y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
339 gtk_window_get_size(widget, &w, &h);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
340
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
341 if (aud_cfg->show_wm_decorations) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
342 dock_window_resize(widget, w, new_h, w, h);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
343 return;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
344 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
345
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
346 docked_list = get_docked_list(NULL, window_list, widget, 0, 0);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
347 slist = find_shade_list(widget, docked_list, NULL);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
348
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
349 off_y = new_h - h;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
350 do {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
351 orig_off_y = off_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
352 for (node = slist; node; node = g_list_next(node)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
353 gint dx, dy, dwidth, dheight;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
354
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
355 dw = node->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
356 if (dw->w == widget)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
357 continue;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
358 gtk_window_get_position(dw->w, &dx, &dy);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
359 gtk_window_get_size(dw->w, &dwidth, &dheight);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
360 if ((dy >= y) && ((dy + off_y + dheight) > gdk_screen_height()))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
361 off_y -= (dy + off_y + dheight) - gdk_screen_height();
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
362 else if ((dy >= y) && ((dy + dheight) == gdk_screen_height()))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
363 off_y = 0;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
364
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
365 if (((dy >= y) && ((dy + off_y) < 0)))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
366 off_y -= dy + off_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
367 if ((dy < y) && ((dy + (off_y - (new_h - h))) < 0))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
368 off_y -= dy + (off_y - (new_h - h));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
369 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
370 } while (orig_off_y != off_y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
371 if (slist) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
372 GList *mlist = g_list_copy(slist);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
373
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
374 /* Remove this widget from the list */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
375 for (node = mlist; node; node = g_list_next(node)) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
376 dw = node->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
377 if (dw->w == widget) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
378 mlist = g_list_remove_link(mlist, node);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
379 g_list_free_1(node);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
380 break;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
381 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
382 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
383 for (node = mlist; node;) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
384 GList *temp;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
385 gint dx, dy, dwidth, dheight;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
386
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
387 dw = node->data;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
388
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
389 gtk_window_get_position(dw->w, &dx, &dy);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
390 gtk_window_get_size(dw->w, &dwidth, &dheight);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
391 /*
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
392 * Find windows that are directly docked to this window,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
393 * move it, and any windows docked to that window again
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
394 */
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
395 if (is_docked(x, y, w, h, dx, dy, dwidth, dheight) &&
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
396 ((dx + dwidth) > x && dx < (x + w))) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
397 mlist = g_list_remove_link(mlist, node);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
398 g_list_free_1(node);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
399 if (dy > y)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
400 temp = shade_move_list(mlist, dw->w, off_y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
401 else if (off_y - (new_h - h) != 0)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
402 temp = shade_move_list(mlist, dw->w, off_y - (new_h - h));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
403 else
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
404 temp = mlist;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
405 node = mlist = temp;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
406 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
407 else
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
408 node = g_list_next(node);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
409 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
410 g_list_free(mlist);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
411 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
412 g_list_free(slist);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
413 free_docked_list(docked_list);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
414 gtk_window_move(widget, x, y + off_y - (new_h - h));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
415 dock_window_resize(widget, w, new_h, w, h);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
416 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
417
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
418 void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
419 dock_move_press(GList * window_list, GtkWindow * w,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
420 GdkEventButton * event, gboolean move_list)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
421 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
422 gint mx, my;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
423 DockedWindow *dwin;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
424
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
425 if (aud_cfg->show_wm_decorations)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
426 return;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
427
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
428 gtk_window_present(w);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
429 mx = event->x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
430 my = event->y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
431 gtk_object_set_data(GTK_OBJECT(w), "move_offset_x", GINT_TO_POINTER(mx));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
432 gtk_object_set_data(GTK_OBJECT(w), "move_offset_y", GINT_TO_POINTER(my));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
433 if (move_list)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
434 gtk_object_set_data(GTK_OBJECT(w), "docked_list",
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
435 get_docked_list(NULL, window_list, w, 0, 0));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
436 else {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
437 dwin = g_new0(DockedWindow, 1);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
438 dwin->w = w;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
439 gtk_object_set_data(GTK_OBJECT(w), "docked_list",
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
440 g_list_append(NULL, dwin));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
441 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
442 gtk_object_set_data(GTK_OBJECT(w), "window_list", window_list);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
443 gtk_object_set_data(GTK_OBJECT(w), "is_moving", GINT_TO_POINTER(1));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
444 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
445
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
446 void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
447 dock_move_motion(GtkWindow * w, GdkEventMotion * event)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
448 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
449 gint offset_x, offset_y, x, y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
450 GList *dlist;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
451 GList *window_list;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
452
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
453 if (!gtk_object_get_data(GTK_OBJECT(w), "is_moving"))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
454 return;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
455
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
456 offset_x =
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
457 GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(w), "move_offset_x"));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
458 offset_y =
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
459 GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(w), "move_offset_y"));
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
460 dlist = gtk_object_get_data(GTK_OBJECT(w), "docked_list");
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
461 window_list = gtk_object_get_data(GTK_OBJECT(w), "window_list");
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
462
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
463 x = event->x_root - offset_x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
464 y = event->y_root - offset_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
465
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
466 calc_snap_offset(dlist, window_list, x, y, &offset_x, &offset_y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
467 x += offset_x;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
468 y += offset_y;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
469
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
470 docked_list_move(dlist, x, y);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
471 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
472
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
473 void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
474 dock_move_release(GtkWindow * w)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
475 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
476 GList *dlist;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
477 gtk_object_remove_data(GTK_OBJECT(w), "is_moving");
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
478 gtk_object_remove_data(GTK_OBJECT(w), "move_offset_x");
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
479 gtk_object_remove_data(GTK_OBJECT(w), "move_offset_y");
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
480 if ((dlist = gtk_object_get_data(GTK_OBJECT(w), "docked_list")) != NULL)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
481 free_docked_list(dlist);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
482 gtk_object_remove_data(GTK_OBJECT(w), "docked_list");
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
483 gtk_object_remove_data(GTK_OBJECT(w), "window_list");
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
484 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
485
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
486 gboolean
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
487 dock_is_moving(GtkWindow * w)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
488 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
489 if (gtk_object_get_data(GTK_OBJECT(w), "is_moving"))
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
490 return TRUE;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
491 return FALSE;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
492 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
493
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
494 GList *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
495 dock_add_window(GList * list, GtkWindow * window)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
496 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
497 return g_list_append(list, window);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
498 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
499
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
500 GList *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
501 dock_remove_window(GList * list, GtkWindow * window)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
502 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
503 return g_list_remove(list, window);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
504 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
505
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
506 GList *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
507 dock_window_set_decorated(GList * list, GtkWindow * window,
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
508 gboolean decorated)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
509 {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
510 if (gtk_window_get_decorated(window) == decorated)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
511 return list;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
512
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
513 if (decorated)
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
514 list = dock_remove_window(list, window);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
515 else
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
516 list = dock_add_window(list, window);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
517
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
518 gtk_window_set_decorated(window, decorated);
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
519
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
520 return list;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
521 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
522
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
523 GList *
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
524 get_dock_window_list() {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
525 return dock_window_list;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
526 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
527
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
528 void
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
529 set_dock_window_list(GList * list) {
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
530 dock_window_list = list;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
531 }