Mercurial > audlegacy
annotate src/audacious/ui_skinned_window.c @ 3939:d46d60247826
we don't need to store GtkFixed pointer, do we?
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Thu, 15 Nov 2007 12:38:47 +0100 |
parents | 5a4ef76b1f42 |
children | 51641a875a01 |
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 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
110 static gboolean |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
111 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
|
112 GdkEventMotion *event) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
113 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
114 GtkWidgetClass *widget_class; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
115 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
116 widget_class = (GtkWidgetClass*) parent; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
117 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
118 if (widget_class->motion_notify_event != NULL) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
119 widget_class->motion_notify_event(widget, event); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
120 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
121 if (dock_is_moving(GTK_WINDOW(widget))) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
122 dock_move_motion(GTK_WINDOW(widget), event); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
123 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
124 return FALSE; |
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 |
3249
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
127 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
|
128 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
|
129 gtk_widget_queue_draw(widget); |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
130 return val; |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
131 } |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
132 |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
133 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
|
134 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
|
135 gtk_widget_queue_draw(widget); |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
136 return val; |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
137 } |
eff2e785e3b4
add focus_in and focus_out events
Tomasz Mon <desowin@gmail.com>
parents:
3223
diff
changeset
|
138 |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
139 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
|
140 SkinnedWindow *window = SKINNED_WINDOW(widget); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
141 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
142 GdkPixmap *obj = NULL; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
143 GdkGC *gc; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
144 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
145 gint width = 0, height = 0; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
146 switch (window->type) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
147 case WINDOW_MAIN: |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
148 width = bmp_active_skin->properties.mainwin_width; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
149 height = bmp_active_skin->properties.mainwin_height; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
150 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
151 case WINDOW_EQ: |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
152 width = 275; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
153 height = 116; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
154 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
155 case WINDOW_PLAYLIST: |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
156 width = playlistwin_get_width(); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
157 height = cfg.playlist_height; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
158 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
159 default: |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
160 return FALSE; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
161 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
162 obj = gdk_pixmap_new(NULL, width, height, gdk_rgb_get_visual()->depth); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
163 gc = gdk_gc_new(obj); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
164 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
165 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
|
166 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
167 switch (window->type) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
168 case WINDOW_MAIN: |
3933
5a4ef76b1f42
beggining of better dealing with substandard winamp skins - if it doesn't break anything, why not commit this?
Tomasz Mon <desowin@gmail.com>
parents:
3924
diff
changeset
|
169 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_MAIN, 0, 0, 0, 0, width, height); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
170 skin_draw_mainwin_titlebar(bmp_active_skin, obj, gc, cfg.player_shaded, focus || !cfg.dim_titlebar); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
171 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
172 case WINDOW_EQ: |
3933
5a4ef76b1f42
beggining of better dealing with substandard winamp skins - if it doesn't break anything, why not commit this?
Tomasz Mon <desowin@gmail.com>
parents:
3924
diff
changeset
|
173 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_EQMAIN, 0, 0, 0, 0, width, height); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
174 if (focus || !cfg.dim_titlebar) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
175 if (!cfg.equalizer_shaded) |
3933
5a4ef76b1f42
beggining of better dealing with substandard winamp skins - if it doesn't break anything, why not commit this?
Tomasz Mon <desowin@gmail.com>
parents:
3924
diff
changeset
|
176 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_EQMAIN, 0, 134, 0, 0, width, 14); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
177 else |
3933
5a4ef76b1f42
beggining of better dealing with substandard winamp skins - if it doesn't break anything, why not commit this?
Tomasz Mon <desowin@gmail.com>
parents:
3924
diff
changeset
|
178 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, 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
|
179 } else { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
180 if (!cfg.equalizer_shaded) |
3933
5a4ef76b1f42
beggining of better dealing with substandard winamp skins - if it doesn't break anything, why not commit this?
Tomasz Mon <desowin@gmail.com>
parents:
3924
diff
changeset
|
181 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_EQMAIN, 0, 149, 0, 0, width, 14); |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
182 else |
3933
5a4ef76b1f42
beggining of better dealing with substandard winamp skins - if it doesn't break anything, why not commit this?
Tomasz Mon <desowin@gmail.com>
parents:
3924
diff
changeset
|
183 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, 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
|
184 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
185 break; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
186 case WINDOW_PLAYLIST: |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
187 focus |= !cfg.dim_titlebar; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
188 if (cfg.playlist_shaded) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
189 skin_draw_playlistwin_shaded(bmp_active_skin, obj, gc, playlistwin_get_width(), focus); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
190 } else { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
191 skin_draw_playlistwin_frame(bmp_active_skin, obj, gc, playlistwin_get_width(), cfg.playlist_height, focus); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
192 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
193 break; |
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 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
196 GdkPixmap *image = NULL; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
197 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
198 if (window->type != WINDOW_PLAYLIST && cfg.doublesize) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
199 image = create_dblsize_pixmap(obj); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
200 } else { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
201 image = gdk_pixmap_new(NULL, width, height, gdk_rgb_get_visual()->depth); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
202 gdk_draw_drawable (image, gc, obj, 0, 0, 0, 0, width, height); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
203 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
204 g_object_unref(obj); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
205 gdk_draw_drawable (widget->window, gc, image, 0, 0, 0, 0, width*(1+cfg.doublesize), height*(1+cfg.doublesize)); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
206 g_object_unref(gc); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
207 g_object_unref(image); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
208 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
209 return FALSE; |
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 |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
212 static void |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
213 ui_skinned_window_class_init(SkinnedWindowClass *klass) |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
214 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
215 GtkWidgetClass *widget_class; |
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 widget_class = (GtkWidgetClass*) klass; |
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 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
|
220 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
221 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
|
222 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
|
223 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
|
224 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
|
225 widget_class->focus_out_event = ui_skinned_window_focus_out; |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
226 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
227 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
228 void |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
229 ui_skinned_window_hide(SkinnedWindow *window) |
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 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
|
232 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
233 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
|
234 gtk_widget_hide(GTK_WIDGET(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 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
237 void |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
238 ui_skinned_window_show(SkinnedWindow *window) |
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 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
|
241 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
242 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
|
243 gtk_widget_show_all(GTK_WIDGET(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 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
246 static void |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
247 ui_skinned_window_init(GtkWidget *widget) |
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 SkinnedWindow *window; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
250 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
|
251 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
|
252 window->y = -1; |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
253 } |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
254 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
255 GtkWidget * |
3068
c5189bc4100b
Refactor skinned window code.
William Pitcock <nenolod@atheme-project.org>
parents:
3067
diff
changeset
|
256 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
|
257 { |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
258 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
|
259 GtkWindow *window = GTK_WINDOW(widget); |
0ac3c3bc5d4a
Set GTK+ window types.
William Pitcock <nenolod@atheme-project.org>
parents:
2840
diff
changeset
|
260 |
3068
c5189bc4100b
Refactor skinned window code.
William Pitcock <nenolod@atheme-project.org>
parents:
3067
diff
changeset
|
261 window->type = SKINNED_WINDOW_TYPE; |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
262 |
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
|
263 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
|
264 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
|
265 |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
266 gtk_widget_add_events(GTK_WIDGET(widget), |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
267 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
|
268 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
|
269 GDK_SCROLL_MASK | GDK_KEY_PRESS_MASK | |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
270 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
|
271 gtk_widget_realize(GTK_WIDGET(widget)); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
272 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
273 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
|
274 GTK_WINDOW(widget), cfg.show_wm_decorations); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
275 gtk_widget_set_app_paintable(GTK_WIDGET(widget), TRUE); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
276 |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
277 ui_skinned_cursor_set(GTK_WIDGET(widget)); |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
278 |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
279 if (!strcmp(wmclass_name, "player")) |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
280 SKINNED_WINDOW(widget)->type = WINDOW_MAIN; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
281 if (!strcmp(wmclass_name, "equalizer")) |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
282 SKINNED_WINDOW(widget)->type = WINDOW_EQ; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
283 if (!strcmp(wmclass_name, "playlist")) |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
284 SKINNED_WINDOW(widget)->type = WINDOW_PLAYLIST; |
2525 | 285 |
2821 | 286 /* GtkFixed hasn't got its GdkWindow, this means that it can be used to |
287 display widgets while the logo below will be displayed anyway; | |
288 however fixed positions are not that great, cause the button sizes may (will) | |
289 vary depending on the gtk style used, so it's not possible to center | |
290 them unless a fixed width and heigth is forced (and this may bring to cutted | |
291 text if someone, i.e., uses a big font for gtk widgets); | |
292 other types of container most likely have their GdkWindow, this simply | |
293 means that the logo must be drawn on the container widget, instead of the | |
294 window; otherwise, it won't be displayed correctly */ | |
295 SKINNED_WINDOW(widget)->fixed = gtk_fixed_new(); | |
2840 | 296 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
|
297 return widget; |
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff
changeset
|
298 } |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
299 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
300 void ui_skinned_window_draw_all(GtkWidget *widget) { |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
301 if (SKINNED_WINDOW(widget)->type == WINDOW_MAIN) |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
302 mainwin_refresh_hints(); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
303 |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
304 gtk_widget_queue_draw(widget); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
305 GList *iter; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
306 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
|
307 GtkFixedChild *child_data = (GtkFixedChild *) iter->data; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
308 GtkWidget *child = child_data->widget; |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
309 gtk_widget_queue_draw(child); |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
310 } |
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
311 } |