Mercurial > audlegacy
annotate src/audacious/legacy/ui_skinned_menurow.c @ 4702:1cdfff982241
temporary fix until we get rid of legacy directory
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Sun, 06 Jul 2008 18:46:11 +0200 |
parents | 3a56d2786063 |
children |
rev | line source |
---|---|
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1 /* |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
2 * Audacious - a cross-platform multimedia player |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
3 * Copyright (c) 2007 Tomasz Moń |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
4 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
5 * Based on: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
6 * BMP - Cross-platform multimedia player |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
7 * Copyright (C) 2003-2004 BMP development team. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
8 * XMMS: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
9 * Copyright (C) 1998-2003 XMMS development team. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
10 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
11 * This program is free software; you can redistribute it and/or modify |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
12 * it under the terms of the GNU General Public License as published by |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
13 * the Free Software Foundation; under version 3 of the License. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
14 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
18 * GNU General Public License for more details. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
19 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
21 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
22 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
23 * The Audacious team does not consider modular code linking to |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
24 * Audacious or using our public API to be a derived work. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
25 */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
26 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
27 #include "ui_skinned_menurow.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
28 #include "main.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
29 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
30 enum { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
31 DOUBLED, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
32 CHANGE, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
33 RELEASE, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
34 LAST_SIGNAL |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
35 }; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
36 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
37 static void ui_skinned_menurow_class_init (UiSkinnedMenurowClass *klass); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
38 static void ui_skinned_menurow_init (UiSkinnedMenurow *menurow); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
39 static void ui_skinned_menurow_destroy (GtkObject *object); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
40 static void ui_skinned_menurow_realize (GtkWidget *widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
41 static void ui_skinned_menurow_size_request (GtkWidget *widget, GtkRequisition *requisition); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
42 static void ui_skinned_menurow_size_allocate (GtkWidget *widget, GtkAllocation *allocation); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
43 static gboolean ui_skinned_menurow_expose (GtkWidget *widget, GdkEventExpose *event); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
44 static MenuRowItem menurow_find_selected (UiSkinnedMenurow * mr, gint x, gint y); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
45 static gboolean ui_skinned_menurow_button_press (GtkWidget *widget, GdkEventButton *event); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
46 static gboolean ui_skinned_menurow_button_release (GtkWidget *widget, GdkEventButton *event); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
47 static gboolean ui_skinned_menurow_motion_notify (GtkWidget *widget, GdkEventMotion *event); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
48 static void ui_skinned_menurow_toggle_scaled (UiSkinnedMenurow *menurow); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
49 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
50 static GtkWidgetClass *parent_class = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
51 static guint menurow_signals[LAST_SIGNAL] = { 0 }; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
52 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
53 GType ui_skinned_menurow_get_type() { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
54 static GType menurow_type = 0; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
55 if (!menurow_type) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
56 static const GTypeInfo menurow_info = { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
57 sizeof (UiSkinnedMenurowClass), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
58 NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
59 NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
60 (GClassInitFunc) ui_skinned_menurow_class_init, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
61 NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
62 NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
63 sizeof (UiSkinnedMenurow), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
64 0, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
65 (GInstanceInitFunc) ui_skinned_menurow_init, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
66 }; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
67 menurow_type = g_type_register_static (GTK_TYPE_WIDGET, "UiSkinnedMenurow_", &menurow_info, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
68 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
69 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
70 return menurow_type; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
71 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
72 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
73 static void ui_skinned_menurow_class_init(UiSkinnedMenurowClass *klass) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
74 GObjectClass *gobject_class; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
75 GtkObjectClass *object_class; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
76 GtkWidgetClass *widget_class; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
77 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
78 gobject_class = G_OBJECT_CLASS(klass); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
79 object_class = (GtkObjectClass*) klass; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
80 widget_class = (GtkWidgetClass*) klass; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
81 parent_class = gtk_type_class (gtk_widget_get_type ()); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
82 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
83 object_class->destroy = ui_skinned_menurow_destroy; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
84 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
85 widget_class->realize = ui_skinned_menurow_realize; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
86 widget_class->expose_event = ui_skinned_menurow_expose; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
87 widget_class->size_request = ui_skinned_menurow_size_request; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
88 widget_class->size_allocate = ui_skinned_menurow_size_allocate; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
89 widget_class->button_press_event = ui_skinned_menurow_button_press; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
90 widget_class->button_release_event = ui_skinned_menurow_button_release; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
91 widget_class->motion_notify_event = ui_skinned_menurow_motion_notify; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
92 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
93 klass->scaled = ui_skinned_menurow_toggle_scaled; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
94 klass->change = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
95 klass->release = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
96 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
97 menurow_signals[DOUBLED] = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
98 g_signal_new ("toggle-scaled", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
99 G_STRUCT_OFFSET (UiSkinnedMenurowClass, scaled), NULL, NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
100 gtk_marshal_VOID__VOID, G_TYPE_NONE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
101 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
102 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
103 menurow_signals[CHANGE] = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
104 g_signal_new ("change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
105 G_STRUCT_OFFSET (UiSkinnedMenurowClass, change), NULL, NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
106 gtk_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
107 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
108 menurow_signals[RELEASE] = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
109 g_signal_new ("release", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
110 G_STRUCT_OFFSET (UiSkinnedMenurowClass, release), NULL, NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
111 g_cclosure_marshal_VOID__UINT_POINTER, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_POINTER); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
112 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
113 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
114 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
115 static void ui_skinned_menurow_init(UiSkinnedMenurow *menurow) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
116 menurow->scale_selected = cfg.scaled; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
117 menurow->always_selected = cfg.always_on_top; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
118 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
119 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
120 GtkWidget* ui_skinned_menurow_new(GtkWidget *fixed, gint x, gint y, gint nx, gint ny, gint sx, gint sy, SkinPixmapId si) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
121 UiSkinnedMenurow *menurow = g_object_new (ui_skinned_menurow_get_type (), NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
122 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
123 menurow->x = x; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
124 menurow->y = y; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
125 menurow->width = 8; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
126 menurow->height = 43; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
127 menurow->nx = nx; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
128 menurow->ny = ny; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
129 menurow->sx = sx; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
130 menurow->sy = sy; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
131 menurow->selected = MENUROW_NONE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
132 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
133 menurow->skin_index = si; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
134 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
135 menurow->scaled = FALSE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
136 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
137 gtk_fixed_put(GTK_FIXED(fixed), GTK_WIDGET(menurow), menurow->x, menurow->y); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
138 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
139 return GTK_WIDGET(menurow); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
140 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
141 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
142 static void ui_skinned_menurow_destroy(GtkObject *object) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
143 UiSkinnedMenurow *menurow; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
144 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
145 g_return_if_fail (object != NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
146 g_return_if_fail (UI_SKINNED_IS_MENUROW (object)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
147 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
148 menurow = UI_SKINNED_MENUROW (object); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
149 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
150 if (GTK_OBJECT_CLASS (parent_class)->destroy) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
151 (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
152 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
153 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
154 static void ui_skinned_menurow_realize(GtkWidget *widget) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
155 UiSkinnedMenurow *menurow; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
156 GdkWindowAttr attributes; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
157 gint attributes_mask; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
158 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
159 g_return_if_fail (widget != NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
160 g_return_if_fail (UI_SKINNED_IS_MENUROW(widget)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
161 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
162 GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
163 menurow = UI_SKINNED_MENUROW(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
164 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
165 attributes.x = widget->allocation.x; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
166 attributes.y = widget->allocation.y; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
167 attributes.width = widget->allocation.width; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
168 attributes.height = widget->allocation.height; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
169 attributes.wclass = GDK_INPUT_OUTPUT; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
170 attributes.window_type = GDK_WINDOW_CHILD; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
171 attributes.event_mask = gtk_widget_get_events(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
172 attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
173 GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
174 attributes.visual = gtk_widget_get_visual(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
175 attributes.colormap = gtk_widget_get_colormap(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
176 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
177 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
178 widget->window = gdk_window_new(widget->parent->window, &attributes, attributes_mask); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
179 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
180 widget->style = gtk_style_attach(widget->style, widget->window); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
181 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
182 gdk_window_set_user_data(widget->window, widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
183 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
184 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
185 static void ui_skinned_menurow_size_request(GtkWidget *widget, GtkRequisition *requisition) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
186 UiSkinnedMenurow *menurow = UI_SKINNED_MENUROW(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
187 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
188 requisition->width = menurow->width*(menurow->scaled ? cfg.scale_factor : 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
189 requisition->height = menurow->height*(menurow->scaled ? cfg.scale_factor : 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
190 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
191 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
192 static void ui_skinned_menurow_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
193 UiSkinnedMenurow *menurow = UI_SKINNED_MENUROW (widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
194 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
195 widget->allocation = *allocation; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
196 widget->allocation.x *= (menurow->scaled ? cfg.scale_factor : 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
197 widget->allocation.y *= (menurow->scaled ? cfg.scale_factor : 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
198 if (GTK_WIDGET_REALIZED (widget)) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
199 gdk_window_move_resize(widget->window, widget->allocation.x, widget->allocation.y, allocation->width, allocation->height); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
200 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
201 menurow->x = widget->allocation.x/(menurow->scaled ? cfg.scale_factor : 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
202 menurow->y = widget->allocation.y/(menurow->scaled ? cfg.scale_factor : 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
203 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
204 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
205 static gboolean ui_skinned_menurow_expose(GtkWidget *widget, GdkEventExpose *event) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
206 g_return_val_if_fail (widget != NULL, FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
207 g_return_val_if_fail (UI_SKINNED_IS_MENUROW (widget), FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
208 g_return_val_if_fail (event != NULL, FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
209 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
210 UiSkinnedMenurow *menurow = UI_SKINNED_MENUROW (widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
211 g_return_val_if_fail (menurow->width > 0 && menurow->height > 0, FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
212 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
213 GdkPixbuf *obj = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
214 obj = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, menurow->width, menurow->height); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
215 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
216 if (menurow->selected == MENUROW_NONE) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
217 if (cfg.always_show_cb || menurow->pushed) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
218 skin_draw_pixbuf(widget, aud_active_skin, obj, menurow->skin_index, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
219 menurow->nx, menurow->ny, 0, 0, 8, 43); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
220 else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
221 skin_draw_pixbuf(widget, aud_active_skin, obj, menurow->skin_index, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
222 menurow->nx + 8, menurow->ny, 0, 0, 8, 43); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
223 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
224 else { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
225 skin_draw_pixbuf(widget, aud_active_skin, obj, menurow->skin_index, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
226 menurow->sx + ((menurow->selected - 1) * 8), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
227 menurow->sy, 0, 0, 8, 43); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
228 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
229 if (cfg.always_show_cb || menurow->pushed) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
230 if (menurow->always_selected) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
231 skin_draw_pixbuf(widget, aud_active_skin, obj, menurow->skin_index, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
232 menurow->sx + 8, menurow->sy + 10, 0, 10, 8, 8); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
233 if (menurow->scale_selected) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
234 skin_draw_pixbuf(widget, aud_active_skin, obj, menurow->skin_index, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
235 menurow->sx + 24, menurow->sy + 26, 0, 26, 8, 8); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
236 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
237 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
238 ui_skinned_widget_draw(widget, obj, menurow->width, menurow->height, menurow->scaled); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
239 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
240 g_object_unref(obj); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
241 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
242 return FALSE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
243 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
244 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
245 static MenuRowItem menurow_find_selected(UiSkinnedMenurow * mr, gint x, gint y) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
246 MenuRowItem ret = MENUROW_NONE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
247 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
248 x = x/(mr->scaled ? cfg.scale_factor : 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
249 y = y/(mr->scaled ? cfg.scale_factor : 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
250 if (x > 0 && x < 8) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
251 if (y >= 0 && y <= 10) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
252 ret = MENUROW_OPTIONS; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
253 if (y >= 10 && y <= 17) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
254 ret = MENUROW_ALWAYS; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
255 if (y >= 18 && y <= 25) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
256 ret = MENUROW_FILEINFOBOX; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
257 if (y >= 26 && y <= 33) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
258 ret = MENUROW_SCALE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
259 if (y >= 34 && y <= 42) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
260 ret = MENUROW_VISUALIZATION; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
261 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
262 return ret; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
263 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
264 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
265 static gboolean ui_skinned_menurow_button_press(GtkWidget *widget, GdkEventButton *event) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
266 g_return_val_if_fail (widget != NULL, FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
267 g_return_val_if_fail (UI_SKINNED_IS_MENUROW (widget), FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
268 g_return_val_if_fail (event != NULL, FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
269 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
270 UiSkinnedMenurow *menurow = UI_SKINNED_MENUROW (widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
271 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
272 if (event->type == GDK_BUTTON_PRESS) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
273 if (event->button == 1) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
274 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
275 menurow->pushed = TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
276 menurow->selected = menurow_find_selected(menurow, event->x, event->y); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
277 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
278 gtk_widget_queue_draw(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
279 g_signal_emit_by_name(widget, "change", menurow->selected); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
280 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
281 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
282 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
283 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
284 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
285 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
286 static gboolean ui_skinned_menurow_button_release(GtkWidget *widget, GdkEventButton *event) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
287 UiSkinnedMenurow *menurow = UI_SKINNED_MENUROW(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
288 if (menurow->pushed) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
289 menurow->pushed = FALSE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
290 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
291 if (menurow->selected == MENUROW_ALWAYS) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
292 menurow->always_selected = !menurow->always_selected; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
293 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
294 if (menurow->selected == MENUROW_SCALE) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
295 menurow->scale_selected = !menurow->scale_selected; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
296 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
297 if ((int)(menurow->selected) != -1) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
298 g_signal_emit_by_name(widget, "release", menurow->selected, event); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
299 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
300 menurow->selected = MENUROW_NONE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
301 gtk_widget_queue_draw(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
302 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
303 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
304 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
305 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
306 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
307 static gboolean ui_skinned_menurow_motion_notify(GtkWidget *widget, GdkEventMotion *event) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
308 g_return_val_if_fail (widget != NULL, FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
309 g_return_val_if_fail (UI_SKINNED_IS_MENUROW (widget), FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
310 g_return_val_if_fail (event != NULL, FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
311 UiSkinnedMenurow *menurow = UI_SKINNED_MENUROW(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
312 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
313 if (menurow->pushed) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
314 menurow->selected = menurow_find_selected(menurow, event->x, event->y); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
315 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
316 gtk_widget_queue_draw(widget); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
317 g_signal_emit_by_name(widget, "change", menurow->selected); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
318 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
319 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
320 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
321 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
322 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
323 static void ui_skinned_menurow_toggle_scaled(UiSkinnedMenurow *menurow) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
324 GtkWidget *widget = GTK_WIDGET (menurow); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
325 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
326 menurow->scaled = !menurow->scaled; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
327 gtk_widget_set_size_request(widget, menurow->width* (menurow->scaled ? cfg.scale_factor : 1), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
328 menurow->height * (menurow->scaled ? cfg.scale_factor : 1)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
329 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
330 gtk_widget_queue_draw(GTK_WIDGET(menurow)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
331 } |