annotate src/audacious/ui_skinned_window.c @ 3059:f58cbfe8df1b

use create_dblsize_image for doueblesizing
author Tomasz Mon <desowin@gmail.com>
date Fri, 13 Jul 2007 12:52:36 +0200
parents 53dd8641b4d1
children bb41a2e8ecbe 0ac3c3bc5d4a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
7 * the Free Software Foundation; under version 2 of the License.
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
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
17 * 02110-1301, USA.
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
18 */
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 #include "platform/smartinclude.h"
2496
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
21 #include "widgets/widgetcore.h"
2494
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
22
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
23 #include <gtk/gtkmain.h>
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
24 #include <glib-object.h>
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
25 #include <glib/gmacros.h>
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
26 #include <gtk/gtkmarshal.h>
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
27 #include <gtk/gtkwindow.h>
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
28
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
29 #include "main.h"
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
30 #include "dock.h"
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
31 #include "ui_skinned_window.h"
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
32 #include "ui_skinned_cursor.h"
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
33
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
34 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
35 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
36 static GtkWindowClass *parent = NULL;
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 GType
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
39 ui_skinned_window_get_type(void)
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
40 {
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
41 static GType window_type = 0;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
42
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
43 if (!window_type)
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 const GTypeInfo window_info =
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 sizeof (SkinnedWindowClass),
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
48 NULL, /* base_init */
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
49 NULL, /* base_finalize */
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
50 (GClassInitFunc) ui_skinned_window_class_init,
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
51 NULL, /* class_finalize */
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
52 NULL, /* class_data */
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
53 sizeof (SkinnedWindow),
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
54 0, /* n_preallocs */
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
55 (GInstanceInitFunc) ui_skinned_window_init
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
56 };
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
57
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
58 window_type =
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
59 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
60 &window_info, 0);
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
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
63 return window_type;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
64 }
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 static gboolean
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
67 ui_skinned_window_configure(GtkWidget *widget,
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
68 GdkEventConfigure *event)
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 GtkWidgetClass *widget_class;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
71 SkinnedWindow *window = SKINNED_WINDOW(widget);
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
72
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
73 widget_class = (GtkWidgetClass*) parent;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
74
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
75 if (widget_class->configure_event != NULL)
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
76 widget_class->configure_event(widget, event);
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
77
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
78 window->x = event->x;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
79 window->y = event->y;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
80
2530
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2525
diff changeset
81 #if 0
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2525
diff changeset
82 g_print("%p window->x = %d, window->y = %d\n", window, window->x, window->y);
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2525
diff changeset
83 #endif
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2525
diff changeset
84
2494
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
85 return FALSE;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
86 }
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
87
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
88 static gboolean
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
89 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
90 GdkEventMotion *event)
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
91 {
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
92 GtkWidgetClass *widget_class;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
93
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
94 widget_class = (GtkWidgetClass*) parent;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
95
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
96 if (widget_class->motion_notify_event != NULL)
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
97 widget_class->motion_notify_event(widget, event);
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
98
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
99 if (dock_is_moving(GTK_WINDOW(widget)))
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
100 dock_move_motion(GTK_WINDOW(widget), event);
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
101
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
102 return FALSE;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
103 }
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
104
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
105 static void
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
106 ui_skinned_window_class_init(SkinnedWindowClass *klass)
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
107 {
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
108 GtkWidgetClass *widget_class;
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 widget_class = (GtkWidgetClass*) klass;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
111
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
112 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
113
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
114 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
115 widget_class->motion_notify_event = ui_skinned_window_motion_notify_event;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
116 }
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 void
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
119 ui_skinned_window_hide(SkinnedWindow *window)
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 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
122
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
123 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
124 gtk_widget_hide(GTK_WIDGET(window));
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
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
127 void
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
128 ui_skinned_window_show(SkinnedWindow *window)
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 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
131
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
132 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
133 gtk_widget_show_all(GTK_WIDGET(window));
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
134 }
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 static void
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
137 ui_skinned_window_init(GtkWidget *widget)
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
138 {
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
139 SkinnedWindow *window;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
140 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
141 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
142 window->y = -1;
2494
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
143 }
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
144
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
145 GtkWidget *
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
146 ui_skinned_window_new(GtkWindowType type, const gchar *wmclass_name)
2494
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
147 {
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
148 GtkWidget *widget = g_object_new(ui_skinned_window_get_type(), NULL);
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
149
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
150 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
151 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
152
2494
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
153 gtk_widget_add_events(GTK_WIDGET(widget),
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
154 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
155 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
156 GDK_SCROLL_MASK | GDK_KEY_PRESS_MASK |
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
157 GDK_VISIBILITY_NOTIFY_MASK);
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
158 gtk_widget_realize(GTK_WIDGET(widget));
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
159
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
160 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
161 GTK_WINDOW(widget), cfg.show_wm_decorations);
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
162 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
163
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
164 ui_skinned_cursor_set(GTK_WIDGET(widget));
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
165
2525
ddd127429fc6 [svn] - move the GC into the SkinnedWindow class.
nenolod
parents: 2515
diff changeset
166 SKINNED_WINDOW(widget)->gc = gdk_gc_new(widget->window);
ddd127429fc6 [svn] - move the GC into the SkinnedWindow class.
nenolod
parents: 2515
diff changeset
167
2821
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
168 /* GtkFixed hasn't got its GdkWindow, this means that it can be used to
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
169 display widgets while the logo below will be displayed anyway;
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
170 however fixed positions are not that great, cause the button sizes may (will)
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
171 vary depending on the gtk style used, so it's not possible to center
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
172 them unless a fixed width and heigth is forced (and this may bring to cutted
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
173 text if someone, i.e., uses a big font for gtk widgets);
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
174 other types of container most likely have their GdkWindow, this simply
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
175 means that the logo must be drawn on the container widget, instead of the
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
176 window; otherwise, it won't be displayed correctly */
ade60a2c52fb [svn] beginning of widgetcore rewrite
desowin
parents: 2651
diff changeset
177 SKINNED_WINDOW(widget)->fixed = gtk_fixed_new();
2840
53dd8641b4d1 fix flickering
Tomasz Mon <desowin@gmail.com>
parents: 2821
diff changeset
178 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
179 return widget;
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents:
diff changeset
180 }
2496
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
181
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
182 void
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
183 ui_skinned_window_widgetlist_associate(GtkWidget * widget, Widget * w)
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
184 {
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
185 SkinnedWindow *sw;
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
186
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
187 g_return_if_fail(widget != NULL);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
188 g_return_if_fail(w != NULL);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
189
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
190 sw = SKINNED_WINDOW(widget);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
191
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
192 sw->widget_list = g_list_append(sw->widget_list, w);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
193 }
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
194
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
195 void
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
196 ui_skinned_window_widgetlist_dissociate(GtkWidget * widget, Widget * w)
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
197 {
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
198 SkinnedWindow *sw;
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
199
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
200 g_return_if_fail(widget != NULL);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
201 g_return_if_fail(w != NULL);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
202
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
203 sw = SKINNED_WINDOW(widget);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
204
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
205 sw->widget_list = g_list_remove(sw->widget_list, w);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
206 }
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
207
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
208 gboolean
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
209 ui_skinned_window_widgetlist_contained(GtkWidget * widget, gint x, gint y)
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
210 {
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
211 SkinnedWindow *sw;
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
212 GList *l;
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
213
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
214 g_return_val_if_fail(widget != NULL, FALSE);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
215
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
216 sw = SKINNED_WINDOW(widget);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
217
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
218 for (l = sw->widget_list; l != NULL; l = g_list_next(l))
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
219 {
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
220 Widget *w = WIDGET(l->data);
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
221
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
222 if (widget_contains(WIDGET(w), x, y) == TRUE)
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
223 return TRUE;
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
224 }
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
225
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
226 return FALSE;
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
227 }
71bee08db1c6 [svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents: 2494
diff changeset
228