Mercurial > audlegacy
annotate src/audacious/ui_skinned_window.c @ 4502:3211a6b15fd3
Define EGGSM_{LIBS,CFLAGS} with =, not +=
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 21 Apr 2008 23:37:33 +0300 |
parents | de33c83aa06f |
children | 246244ead30e |
rev | line source |
---|---|
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
1 /* |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
2 * Audacious: A cross-platform multimedia player |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
3 * Copyright (c) 2007 William Pitcock <nenolod -at- sacredspiral.co.uk> |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
4 * |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3068
diff
changeset
|
7 * the Free Software Foundation; under version 3 of the License. |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
8 * |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
12 * GNU General Public License for more details. |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
13 * |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3068
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3123
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
16 * |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
17 * The Audacious team does not consider modular code linking to |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
18 * Audacious or using our public API to be a derived work. |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
19 */ |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
20 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
21 #include "platform/smartinclude.h" |
3251 | 22 #include "skin.h" |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
23 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
24 #include <gtk/gtkmain.h> |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
25 #include <glib-object.h> |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
26 #include <glib/gmacros.h> |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
27 #include <gtk/gtkmarshal.h> |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
28 #include <gtk/gtkwindow.h> |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
29 #include <string.h> |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
30 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
31 #include "main.h" |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
32 #include "dock.h" |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
33 #include "ui_skinned_window.h" |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
34 #include "ui_skinned_cursor.h" |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
35 #include "util.h" |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
36 #include "ui_playlist.h" |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
37 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
38 static void ui_skinned_window_class_init(SkinnedWindowClass *klass); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
39 static void ui_skinned_window_init(GtkWidget *widget); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
40 static GtkWindowClass *parent = NULL; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
41 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
42 GType |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
43 ui_skinned_window_get_type(void) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
44 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
45 static GType window_type = 0; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
46 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
47 if (!window_type) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
48 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
49 static const GTypeInfo window_info = |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
50 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
51 sizeof (SkinnedWindowClass), |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
52 NULL, /* base_init */ |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
53 NULL, /* base_finalize */ |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
54 (GClassInitFunc) ui_skinned_window_class_init, |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
55 NULL, /* class_finalize */ |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
56 NULL, /* class_data */ |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
57 sizeof (SkinnedWindow), |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
58 0, /* n_preallocs */ |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
59 (GInstanceInitFunc) ui_skinned_window_init |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
60 }; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
61 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
62 window_type = |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
63 g_type_register_static (GTK_TYPE_WINDOW, "SkinnedWindow", |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
64 &window_info, 0); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
65 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
66 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
67 return window_type; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
68 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
69 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
70 static gboolean |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
71 ui_skinned_window_configure(GtkWidget *widget, |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
72 GdkEventConfigure *event) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
73 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
74 GtkWidgetClass *widget_class; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
75 SkinnedWindow *window = SKINNED_WINDOW(widget); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
76 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
77 widget_class = (GtkWidgetClass*) parent; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
78 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
79 if (widget_class->configure_event != NULL) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
80 widget_class->configure_event(widget, event); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
81 |
3311
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
82 if (!GTK_WIDGET_VISIBLE(widget)) |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
83 return FALSE; |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
84 |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
85 switch(window->type) { |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
86 case WINDOW_MAIN: |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
87 if (cfg.show_wm_decorations) |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
88 gdk_window_get_root_origin(widget->window, &cfg.player_x, &cfg.player_y); |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
89 else |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
90 gdk_window_get_deskrelative_origin(widget->window, &cfg.player_x, &cfg.player_y); |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
91 break; |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
92 case WINDOW_EQ: |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
93 cfg.equalizer_x = event->x; |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
94 cfg.equalizer_y = event->y; |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
95 break; |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
96 case WINDOW_PLAYLIST: |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
97 cfg.playlist_x = event->x; |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
98 cfg.playlist_y = event->y; |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
99 break; |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
100 } |
8560d99e36be
revise ui_skinned_window_configure
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
101 |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
102 window->x = event->x; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
103 window->y = event->y; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
104 |
3924
6c85469949af
fix always on top, closes #20
Tomasz Mon <desowin@gmail.com>
parents:
3311
diff
changeset
|
105 gtk_window_set_keep_above(GTK_WINDOW(widget), cfg.always_on_top); |
6c85469949af
fix always on top, closes #20
Tomasz Mon <desowin@gmail.com>
parents:
3311
diff
changeset
|
106 |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
107 return FALSE; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
108 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
109 |
4130
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
110 static void |
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
111 ui_skinned_window_map(GtkWidget *widget) |
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
112 { |
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
113 (* GTK_WIDGET_CLASS (parent)->map) (widget); |
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
114 |
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
115 SkinnedWindow *window = SKINNED_WINDOW(widget); |
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
116 if (window->type == WINDOW_MAIN) |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
117 gtk_widget_shape_combine_mask(widget, skin_get_mask(aud_active_skin, SKIN_MASK_MAIN + cfg.player_shaded), 0, 0); |
4130
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
118 else if (window->type == WINDOW_EQ) |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
119 gtk_widget_shape_combine_mask(widget, skin_get_mask(aud_active_skin, SKIN_MASK_EQ + cfg.equalizer_shaded), 0, 0); |
4130
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
120 } |
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
121 |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
122 static gboolean |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
123 ui_skinned_window_motion_notify_event(GtkWidget *widget, |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
124 GdkEventMotion *event) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
125 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
126 GtkWidgetClass *widget_class; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
127 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
128 widget_class = (GtkWidgetClass*) parent; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
129 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
130 if (widget_class->motion_notify_event != NULL) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
131 widget_class->motion_notify_event(widget, event); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
132 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
133 if (dock_is_moving(GTK_WINDOW(widget))) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
134 dock_move_motion(GTK_WINDOW(widget), event); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
135 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
136 return FALSE; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
137 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
138 |
3249
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
139 static gboolean ui_skinned_window_focus_in(GtkWidget *widget, GdkEventFocus *focus) { |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
140 gboolean val = GTK_WIDGET_CLASS (parent)->focus_in_event (widget, focus); |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
141 gtk_widget_queue_draw(widget); |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
142 return val; |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
143 } |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
144 |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
145 static gboolean ui_skinned_window_focus_out(GtkWidget *widget, GdkEventFocus *focus) { |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
146 gboolean val = GTK_WIDGET_CLASS (parent)->focus_out_event (widget, focus); |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
147 gtk_widget_queue_draw(widget); |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
148 return val; |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
149 } |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
150 |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
151 static gboolean ui_skinned_window_expose(GtkWidget *widget, GdkEventExpose *event) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
152 SkinnedWindow *window = SKINNED_WINDOW(widget); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
153 |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4130
diff
changeset
|
154 GdkPixbuf *obj = NULL; |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
155 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
156 gint width = 0, height = 0; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
157 switch (window->type) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
158 case WINDOW_MAIN: |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
159 width = aud_active_skin->properties.mainwin_width; |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
160 height = aud_active_skin->properties.mainwin_height; |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
161 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
162 case WINDOW_EQ: |
4218
f1074a07ec09
mostly works, but the VIS is broken, and the eq window is too large...more bugs
Cristi Magherusan <majeru@atheme.org>
parents:
4216
diff
changeset
|
163 width = 275 * (cfg.scaled ? cfg.scale_factor : 1); |
f1074a07ec09
mostly works, but the VIS is broken, and the eq window is too large...more bugs
Cristi Magherusan <majeru@atheme.org>
parents:
4216
diff
changeset
|
164 height = 116 * (cfg.scaled ? cfg.scale_factor : 1) ; |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
165 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
166 case WINDOW_PLAYLIST: |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
167 width = playlistwin_get_width(); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
168 height = cfg.playlist_height; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
169 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
170 default: |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
171 return FALSE; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
172 } |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4130
diff
changeset
|
173 obj = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
174 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
175 gboolean focus = gtk_window_has_toplevel_focus(GTK_WINDOW(widget)); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
176 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
177 switch (window->type) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
178 case WINDOW_MAIN: |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
179 skin_draw_pixbuf(widget, aud_active_skin, obj,SKIN_MAIN, 0, 0, 0, 0, width, height); |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
180 skin_draw_mainwin_titlebar(aud_active_skin, obj, cfg.player_shaded, focus || !cfg.dim_titlebar); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
181 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
182 case WINDOW_EQ: |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
183 skin_draw_pixbuf(widget, aud_active_skin, obj, SKIN_EQMAIN, 0, 0, 0, 0, width, height); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
184 if (focus || !cfg.dim_titlebar) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
185 if (!cfg.equalizer_shaded) |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
186 skin_draw_pixbuf(widget, aud_active_skin, obj, SKIN_EQMAIN, 0, 134, 0, 0, width, 14); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
187 else |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
188 skin_draw_pixbuf(widget, aud_active_skin, obj, SKIN_EQ_EX, 0, 0, 0, 0, width, 14); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
189 } else { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
190 if (!cfg.equalizer_shaded) |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
191 skin_draw_pixbuf(widget, aud_active_skin, obj, SKIN_EQMAIN, 0, 149, 0, 0, width, 14); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
192 else |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
193 skin_draw_pixbuf(widget, aud_active_skin, obj, SKIN_EQ_EX, 0, 15, 0, 0, width, 14); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
194 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
195 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
196 case WINDOW_PLAYLIST: |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
197 focus |= !cfg.dim_titlebar; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
198 if (cfg.playlist_shaded) { |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
199 skin_draw_playlistwin_shaded(aud_active_skin, obj, playlistwin_get_width(), focus); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
200 } else { |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4218
diff
changeset
|
201 skin_draw_playlistwin_frame(aud_active_skin, obj, playlistwin_get_width(), cfg.playlist_height, focus); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
202 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
203 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
204 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
205 |
4212
47352b34dbdf
introduce ui_skinned_widget_draw
Tomasz Mon <desowin@gmail.com>
parents:
4195
diff
changeset
|
206 ui_skinned_widget_draw(GTK_WIDGET(window), obj, width, height, |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4212
diff
changeset
|
207 window->type != WINDOW_PLAYLIST && cfg.scaled); |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4130
diff
changeset
|
208 |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
209 g_object_unref(obj); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
210 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
211 return FALSE; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
212 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
213 |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
214 static void |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
215 ui_skinned_window_class_init(SkinnedWindowClass *klass) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
216 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
217 GtkWidgetClass *widget_class; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
218 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
219 widget_class = (GtkWidgetClass*) klass; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
220 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
221 parent = gtk_type_class(gtk_window_get_type()); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
222 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
223 widget_class->configure_event = ui_skinned_window_configure; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
224 widget_class->motion_notify_event = ui_skinned_window_motion_notify_event; |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
225 widget_class->expose_event = ui_skinned_window_expose; |
3249
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
226 widget_class->focus_in_event = ui_skinned_window_focus_in; |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
227 widget_class->focus_out_event = ui_skinned_window_focus_out; |
4130
c2039c3004d6
set windows masks in saner way
Tomasz Mon <desowin@gmail.com>
parents:
4120
diff
changeset
|
228 widget_class->map = ui_skinned_window_map; |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
229 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
230 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
231 void |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
232 ui_skinned_window_hide(SkinnedWindow *window) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
233 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
234 g_return_if_fail(SKINNED_CHECK_WINDOW(window)); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
235 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
236 gtk_window_get_position(GTK_WINDOW(window), &window->x, &window->y); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
237 gtk_widget_hide(GTK_WIDGET(window)); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
238 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
239 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
240 void |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
241 ui_skinned_window_show(SkinnedWindow *window) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
242 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
243 g_return_if_fail(SKINNED_CHECK_WINDOW(window)); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
244 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
245 gtk_window_move(GTK_WINDOW(window), window->x, window->y); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
246 gtk_widget_show_all(GTK_WIDGET(window)); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
247 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
248 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
249 static void |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
250 ui_skinned_window_init(GtkWidget *widget) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
251 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
252 SkinnedWindow *window; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
253 window = SKINNED_WINDOW(widget); |
2651
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2530
diff
changeset
|
254 window->x = -1; |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2530
diff
changeset
|
255 window->y = -1; |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
256 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
257 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
258 GtkWidget * |
3068
c5189bc4100b
Refactor skinned window code.
William Pitcock <nenolod@atheme-project.org>
parents:
3067
diff
changeset
|
259 ui_skinned_window_new(const gchar *wmclass_name) |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
260 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
261 GtkWidget *widget = g_object_new(ui_skinned_window_get_type(), NULL); |
3063
0ac3c3bc5d4a
Set GTK+ window types.
William Pitcock <nenolod@atheme-project.org>
parents:
2840
diff
changeset
|
262 GtkWindow *window = GTK_WINDOW(widget); |
0ac3c3bc5d4a
Set GTK+ window types.
William Pitcock <nenolod@atheme-project.org>
parents:
2840
diff
changeset
|
263 |
3068
c5189bc4100b
Refactor skinned window code.
William Pitcock <nenolod@atheme-project.org>
parents:
3067
diff
changeset
|
264 window->type = SKINNED_WINDOW_TYPE; |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
265 |
2515
319b10203d7c
[svn] gtk_window_set_wmclass() has to be called before gtk_widget_realize(). Patched by Christian "Joker" Birchinger from Gentoo.
chainsaw
parents:
2496
diff
changeset
|
266 if (wmclass_name) |
319b10203d7c
[svn] gtk_window_set_wmclass() has to be called before gtk_widget_realize(). Patched by Christian "Joker" Birchinger from Gentoo.
chainsaw
parents:
2496
diff
changeset
|
267 gtk_window_set_wmclass(GTK_WINDOW(widget), wmclass_name, "Audacious"); |
319b10203d7c
[svn] gtk_window_set_wmclass() has to be called before gtk_widget_realize(). Patched by Christian "Joker" Birchinger from Gentoo.
chainsaw
parents:
2496
diff
changeset
|
268 |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
269 gtk_widget_add_events(GTK_WIDGET(widget), |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
270 GDK_FOCUS_CHANGE_MASK | GDK_BUTTON_MOTION_MASK | |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
271 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
272 GDK_SCROLL_MASK | GDK_KEY_PRESS_MASK | |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
273 GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK); |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
274 gtk_widget_realize(GTK_WIDGET(widget)); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
275 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
276 dock_window_list = dock_window_set_decorated(dock_window_list, |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
277 GTK_WINDOW(widget), cfg.show_wm_decorations); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
278 gtk_widget_set_app_paintable(GTK_WIDGET(widget), TRUE); |
4120
51641a875a01
revise setting mask on windows
Tomasz Mon <desowin@gmail.com>
parents:
3933
diff
changeset
|
279 gdk_window_set_back_pixmap(widget->window, NULL, FALSE); |
51641a875a01
revise setting mask on windows
Tomasz Mon <desowin@gmail.com>
parents:
3933
diff
changeset
|
280 gtk_widget_shape_combine_mask(widget, NULL, 0, 0); |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
281 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
282 ui_skinned_cursor_set(GTK_WIDGET(widget)); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
283 |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
284 if (!strcmp(wmclass_name, "player")) |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
285 SKINNED_WINDOW(widget)->type = WINDOW_MAIN; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
286 if (!strcmp(wmclass_name, "equalizer")) |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
287 SKINNED_WINDOW(widget)->type = WINDOW_EQ; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
288 if (!strcmp(wmclass_name, "playlist")) |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
289 SKINNED_WINDOW(widget)->type = WINDOW_PLAYLIST; |
2525 | 290 |
2821 | 291 /* GtkFixed hasn't got its GdkWindow, this means that it can be used to |
292 display widgets while the logo below will be displayed anyway; | |
293 however fixed positions are not that great, cause the button sizes may (will) | |
294 vary depending on the gtk style used, so it's not possible to center | |
295 them unless a fixed width and heigth is forced (and this may bring to cutted | |
296 text if someone, i.e., uses a big font for gtk widgets); | |
297 other types of container most likely have their GdkWindow, this simply | |
298 means that the logo must be drawn on the container widget, instead of the | |
299 window; otherwise, it won't be displayed correctly */ | |
300 SKINNED_WINDOW(widget)->fixed = gtk_fixed_new(); | |
2840 | 301 gtk_container_add(GTK_CONTAINER(widget), GTK_WIDGET(SKINNED_WINDOW(widget)->fixed)); |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
302 return widget; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
303 } |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
304 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
305 void ui_skinned_window_draw_all(GtkWidget *widget) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
306 if (SKINNED_WINDOW(widget)->type == WINDOW_MAIN) |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
307 mainwin_refresh_hints(); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
308 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
309 gtk_widget_queue_draw(widget); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
310 GList *iter; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
311 for (iter = GTK_FIXED (SKINNED_WINDOW(widget)->fixed)->children; iter; iter = g_list_next (iter)) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
312 GtkFixedChild *child_data = (GtkFixedChild *) iter->data; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
313 GtkWidget *child = child_data->widget; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
314 gtk_widget_queue_draw(child); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
315 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
316 } |