Mercurial > audlegacy
annotate src/audacious/ui_skinned_horizontal_slider.c @ 4195:2281da647da9
beggining of GdkPixbuf transition
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Sat, 19 Jan 2008 06:03:03 +0100 |
parents | 9d4b5cdae3ba |
children | 47352b34dbdf |
rev | line source |
---|---|
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
1 /* |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
2 * Audacious - a cross-platform multimedia player |
3840 | 3 * Copyright (c) 2007 Tomasz Moń |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
4 * |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
5 * Based on: |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
6 * BMP - Cross-platform multimedia player |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
7 * Copyright (C) 2003-2004 BMP development team. |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
8 * XMMS: |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
9 * Copyright (C) 1998-2003 XMMS development team. |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
10 * |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
11 * This program is free software; you can redistribute it and/or modify |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
12 * it under the terms of the GNU General Public License as published by |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3105
diff
changeset
|
13 * the Free Software Foundation; under version 3 of the License. |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
14 * |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
18 * GNU General Public License for more details. |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
19 * |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3105
diff
changeset
|
21 * 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
|
22 * |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
23 * 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
|
24 * Audacious or using our public API to be a derived work. |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
25 */ |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
26 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
27 #include "ui_skinned_horizontal_slider.h" |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
28 #include "main.h" |
3059
f58cbfe8df1b
use create_dblsize_image for doueblesizing
Tomasz Mon <desowin@gmail.com>
parents:
3053
diff
changeset
|
29 #include "util.h" |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
30 |
3105 | 31 #define UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ui_skinned_horizontal_slider_get_type(), UiSkinnedHorizontalSliderPrivate)) |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
32 typedef struct _UiSkinnedHorizontalSliderPrivate UiSkinnedHorizontalSliderPrivate; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
33 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
34 enum { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
35 MOTION, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
36 RELEASE, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
37 DOUBLED, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
38 LAST_SIGNAL |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
39 }; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
40 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
41 struct _UiSkinnedHorizontalSliderPrivate { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
42 SkinPixmapId skin_index; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
43 gboolean double_size; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
44 gint frame, frame_offset, frame_height, min, max; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
45 gint knob_width, knob_height; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
46 gint position; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
47 gint width, height; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
48 gint (*frame_cb) (gint); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
49 }; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
50 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
51 static void ui_skinned_horizontal_slider_class_init (UiSkinnedHorizontalSliderClass *klass); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
52 static void ui_skinned_horizontal_slider_init (UiSkinnedHorizontalSlider *horizontal_slider); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
53 static void ui_skinned_horizontal_slider_destroy (GtkObject *object); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
54 static void ui_skinned_horizontal_slider_realize (GtkWidget *widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
55 static void ui_skinned_horizontal_slider_size_request (GtkWidget *widget, GtkRequisition *requisition); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
56 static void ui_skinned_horizontal_slider_size_allocate (GtkWidget *widget, GtkAllocation *allocation); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
57 static gboolean ui_skinned_horizontal_slider_expose (GtkWidget *widget, GdkEventExpose *event); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
58 static gboolean ui_skinned_horizontal_slider_button_press (GtkWidget *widget, GdkEventButton *event); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
59 static gboolean ui_skinned_horizontal_slider_button_release (GtkWidget *widget, GdkEventButton *event); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
60 static gboolean ui_skinned_horizontal_slider_motion_notify (GtkWidget *widget, GdkEventMotion *event); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
61 static void ui_skinned_horizontal_slider_toggle_doublesize (UiSkinnedHorizontalSlider *horizontal_slider); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
62 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
63 static GtkWidgetClass *parent_class = NULL; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
64 static guint horizontal_slider_signals[LAST_SIGNAL] = { 0 }; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
65 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
66 GType ui_skinned_horizontal_slider_get_type() { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
67 static GType horizontal_slider_type = 0; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
68 if (!horizontal_slider_type) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
69 static const GTypeInfo horizontal_slider_info = { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
70 sizeof (UiSkinnedHorizontalSliderClass), |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
71 NULL, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
72 NULL, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
73 (GClassInitFunc) ui_skinned_horizontal_slider_class_init, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
74 NULL, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
75 NULL, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
76 sizeof (UiSkinnedHorizontalSlider), |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
77 0, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
78 (GInstanceInitFunc) ui_skinned_horizontal_slider_init, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
79 }; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
80 horizontal_slider_type = g_type_register_static (GTK_TYPE_WIDGET, "UiSkinnedHorizontalSlider", &horizontal_slider_info, 0); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
81 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
82 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
83 return horizontal_slider_type; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
84 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
85 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
86 static void ui_skinned_horizontal_slider_class_init(UiSkinnedHorizontalSliderClass *klass) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
87 GObjectClass *gobject_class; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
88 GtkObjectClass *object_class; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
89 GtkWidgetClass *widget_class; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
90 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
91 gobject_class = G_OBJECT_CLASS(klass); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
92 object_class = (GtkObjectClass*) klass; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
93 widget_class = (GtkWidgetClass*) klass; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
94 parent_class = gtk_type_class (gtk_widget_get_type ()); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
95 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
96 object_class->destroy = ui_skinned_horizontal_slider_destroy; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
97 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
98 widget_class->realize = ui_skinned_horizontal_slider_realize; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
99 widget_class->expose_event = ui_skinned_horizontal_slider_expose; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
100 widget_class->size_request = ui_skinned_horizontal_slider_size_request; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
101 widget_class->size_allocate = ui_skinned_horizontal_slider_size_allocate; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
102 widget_class->button_press_event = ui_skinned_horizontal_slider_button_press; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
103 widget_class->button_release_event = ui_skinned_horizontal_slider_button_release; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
104 widget_class->motion_notify_event = ui_skinned_horizontal_slider_motion_notify; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
105 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
106 klass->motion = NULL; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
107 klass->release = NULL; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
108 klass->doubled = ui_skinned_horizontal_slider_toggle_doublesize; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
109 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
110 horizontal_slider_signals[MOTION] = |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
111 g_signal_new ("motion", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
112 G_STRUCT_OFFSET (UiSkinnedHorizontalSliderClass, motion), NULL, NULL, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
113 gtk_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
114 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
115 horizontal_slider_signals[RELEASE] = |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
116 g_signal_new ("release", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
117 G_STRUCT_OFFSET (UiSkinnedHorizontalSliderClass, release), NULL, NULL, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
118 gtk_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
119 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
120 horizontal_slider_signals[DOUBLED] = |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
121 g_signal_new ("toggle-double-size", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
122 G_STRUCT_OFFSET (UiSkinnedHorizontalSliderClass, doubled), NULL, NULL, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
123 gtk_marshal_VOID__VOID, G_TYPE_NONE, 0); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
124 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
125 g_type_class_add_private (gobject_class, sizeof (UiSkinnedHorizontalSliderPrivate)); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
126 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
127 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
128 static void ui_skinned_horizontal_slider_init(UiSkinnedHorizontalSlider *horizontal_slider) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
129 horizontal_slider->pressed = FALSE; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
130 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
131 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
132 GtkWidget* ui_skinned_horizontal_slider_new(GtkWidget *fixed, gint x, gint y, gint w, gint h, gint knx, gint kny, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
133 gint kpx, gint kpy, gint kw, gint kh, gint fh, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
134 gint fo, gint min, gint max, gint(*fcb) (gint), SkinPixmapId si) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
135 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
136 UiSkinnedHorizontalSlider *hs = g_object_new (ui_skinned_horizontal_slider_get_type (), NULL); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
137 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(hs); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
138 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
139 hs->x = x; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
140 hs->y = y; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
141 priv->width = w; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
142 priv->height = h; |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
143 hs->knob_nx = knx; |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
144 hs->knob_ny = kny; |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
145 hs->knob_px = kpx; |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
146 hs->knob_py = kpy; |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
147 priv->knob_width = kw; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
148 priv->knob_height = kh; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
149 priv->frame_height = fh; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
150 priv->frame_offset = fo; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
151 priv->min = min; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
152 priv->position = min; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
153 priv->max = max; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
154 priv->frame_cb = fcb; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
155 if (priv->frame_cb) |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
156 priv->frame = priv->frame_cb(0); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
157 priv->skin_index = si; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
158 |
3939
d46d60247826
we don't need to store GtkFixed pointer, do we?
Tomasz Mon <desowin@gmail.com>
parents:
3933
diff
changeset
|
159 gtk_fixed_put(GTK_FIXED(fixed), GTK_WIDGET(hs), hs->x, hs->y); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
160 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
161 return GTK_WIDGET(hs); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
162 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
163 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
164 static void ui_skinned_horizontal_slider_destroy(GtkObject *object) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
165 UiSkinnedHorizontalSlider *horizontal_slider; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
166 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
167 g_return_if_fail (object != NULL); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
168 g_return_if_fail (UI_SKINNED_IS_HORIZONTAL_SLIDER (object)); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
169 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
170 horizontal_slider = UI_SKINNED_HORIZONTAL_SLIDER (object); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
171 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
172 if (GTK_OBJECT_CLASS (parent_class)->destroy) |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
173 (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
174 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
175 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
176 static void ui_skinned_horizontal_slider_realize(GtkWidget *widget) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
177 UiSkinnedHorizontalSlider *horizontal_slider; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
178 GdkWindowAttr attributes; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
179 gint attributes_mask; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
180 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
181 g_return_if_fail (widget != NULL); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
182 g_return_if_fail (UI_SKINNED_IS_HORIZONTAL_SLIDER(widget)); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
183 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
184 GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
185 horizontal_slider = UI_SKINNED_HORIZONTAL_SLIDER(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
186 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
187 attributes.x = widget->allocation.x; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
188 attributes.y = widget->allocation.y; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
189 attributes.width = widget->allocation.width; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
190 attributes.height = widget->allocation.height; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
191 attributes.wclass = GDK_INPUT_OUTPUT; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
192 attributes.window_type = GDK_WINDOW_CHILD; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
193 attributes.event_mask = gtk_widget_get_events(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
194 attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | |
3051 | 195 GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK; |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
196 attributes.visual = gtk_widget_get_visual(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
197 attributes.colormap = gtk_widget_get_colormap(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
198 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
199 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
200 widget->window = gdk_window_new(widget->parent->window, &attributes, attributes_mask); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
201 |
3052 | 202 widget->style = gtk_style_attach(widget->style, widget->window); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
203 gdk_window_set_user_data(widget->window, widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
204 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
205 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
206 static void ui_skinned_horizontal_slider_size_request(GtkWidget *widget, GtkRequisition *requisition) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
207 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
208 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
209 requisition->width = priv->width*(1+priv->double_size); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
210 requisition->height = priv->height*(1+priv->double_size); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
211 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
212 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
213 static void ui_skinned_horizontal_slider_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
214 UiSkinnedHorizontalSlider *horizontal_slider = UI_SKINNED_HORIZONTAL_SLIDER (widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
215 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(horizontal_slider); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
216 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
217 widget->allocation = *allocation; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
218 widget->allocation.x *= (1+priv->double_size); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
219 widget->allocation.y *= (1+priv->double_size); |
3332 | 220 |
3305
6cadc2ddf4cd
revise 19ad8ea66a03: fix skins with non-standard size posbar
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
221 if (priv->knob_height == priv->height) |
3332 | 222 priv->knob_height = allocation->height/(priv->double_size ? 2 : 1); |
223 priv->width = allocation->width/(priv->double_size ? 2 : 1); | |
224 priv->height = allocation->height/(priv->double_size ? 2 : 1); | |
3305
6cadc2ddf4cd
revise 19ad8ea66a03: fix skins with non-standard size posbar
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
225 |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
226 if (GTK_WIDGET_REALIZED (widget)) |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
227 gdk_window_move_resize(widget->window, widget->allocation.x, widget->allocation.y, allocation->width, allocation->height); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
228 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
229 horizontal_slider->x = widget->allocation.x/(priv->double_size ? 2 : 1); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
230 horizontal_slider->y = widget->allocation.y/(priv->double_size ? 2 : 1); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
231 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
232 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
233 static gboolean ui_skinned_horizontal_slider_expose(GtkWidget *widget, GdkEventExpose *event) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
234 g_return_val_if_fail (widget != NULL, FALSE); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
235 g_return_val_if_fail (UI_SKINNED_IS_HORIZONTAL_SLIDER (widget), FALSE); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
236 g_return_val_if_fail (event != NULL, FALSE); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
237 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
238 UiSkinnedHorizontalSlider *hs = UI_SKINNED_HORIZONTAL_SLIDER (widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
239 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(hs); |
4119 | 240 g_return_val_if_fail (priv->width > 0 && priv->height > 0, FALSE); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
241 |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
242 GdkPixbuf *obj = NULL; |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
243 |
3053
712b3d476e06
Correct slider behaviour in doublesize
Tomasz Mon <desowin@gmail.com>
parents:
3052
diff
changeset
|
244 if (priv->position > priv->max) priv->position = priv->max; |
712b3d476e06
Correct slider behaviour in doublesize
Tomasz Mon <desowin@gmail.com>
parents:
3052
diff
changeset
|
245 else if (priv->position < priv->min) priv->position = priv->min; |
712b3d476e06
Correct slider behaviour in doublesize
Tomasz Mon <desowin@gmail.com>
parents:
3052
diff
changeset
|
246 |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
247 obj = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, priv->width, priv->height); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
248 |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
249 skin_draw_pixbuf(widget, bmp_active_skin, obj, |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
250 priv->skin_index, priv->frame_offset, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
251 priv->frame * priv->frame_height, |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
252 0, 0, priv->width, priv->height); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
253 if (hs->pressed) |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
254 skin_draw_pixbuf(widget, bmp_active_skin, obj, |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
255 priv->skin_index, hs->knob_px, |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
256 hs->knob_py, priv->position, |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
257 ((priv->height - priv->knob_height) / 2), |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
258 priv->knob_width, priv->knob_height); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
259 else |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
260 skin_draw_pixbuf(widget, bmp_active_skin, obj, |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
261 priv->skin_index, hs->knob_nx, |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
262 hs->knob_ny, priv->position, |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
263 ((priv->height - priv->knob_height) / 2), |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
264 priv->knob_width, priv->knob_height); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
265 |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
266 GdkPixbuf *image = NULL; |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
267 if (priv->double_size) { |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
268 image = gdk_pixbuf_scale_simple(obj, priv->width*2, priv->height*2, GDK_INTERP_NEAREST); |
3077
4b076ad636e6
use GdkPixmaps for doublesizing
Tomasz Mon <desowin@gmail.com>
parents:
3059
diff
changeset
|
269 } else { |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
270 image = gdk_pixbuf_copy(obj); |
3077
4b076ad636e6
use GdkPixmaps for doublesizing
Tomasz Mon <desowin@gmail.com>
parents:
3059
diff
changeset
|
271 } |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
272 |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
273 gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0, |
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
274 priv->width*(1+priv->double_size), priv->height*(1+priv->double_size), |
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
275 GDK_RGB_DITHER_NONE, 0, 0); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
276 |
4195
2281da647da9
beggining of GdkPixbuf transition
Tomasz Mon <desowin@gmail.com>
parents:
4119
diff
changeset
|
277 g_object_unref(obj); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
278 g_object_unref(image); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
279 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
280 return FALSE; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
281 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
282 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
283 static gboolean ui_skinned_horizontal_slider_button_press(GtkWidget *widget, GdkEventButton *event) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
284 g_return_val_if_fail (widget != NULL, FALSE); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
285 g_return_val_if_fail (UI_SKINNED_IS_HORIZONTAL_SLIDER (widget), FALSE); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
286 g_return_val_if_fail (event != NULL, FALSE); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
287 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
288 UiSkinnedHorizontalSlider *hs = UI_SKINNED_HORIZONTAL_SLIDER (widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
289 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(hs); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
290 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
291 if (event->type == GDK_BUTTON_PRESS) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
292 if (event->button == 1) { |
3600
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
293 gint x; |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
294 |
3600
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
295 x = event->x - (priv->knob_width / (priv->double_size ? 1 : 2)); |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
296 hs->pressed = TRUE; |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
297 |
3600
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
298 priv->position = x/(1+priv->double_size); |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
299 if (priv->position < priv->min) |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
300 priv->position = priv->min; |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
301 if (priv->position > priv->max) |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
302 priv->position = priv->max; |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
303 if (priv->frame_cb) |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
304 priv->frame = priv->frame_cb(priv->position); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
305 |
3600
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
306 g_signal_emit_by_name(widget, "motion", priv->position); |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
307 gtk_widget_queue_draw(widget); |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
308 } else if (event->button == 3) { |
3724
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3600
diff
changeset
|
309 if (hs->pressed) { |
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3600
diff
changeset
|
310 hs->pressed = FALSE; |
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3600
diff
changeset
|
311 g_signal_emit_by_name(widget, "release", priv->position); |
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3600
diff
changeset
|
312 gtk_widget_queue_draw(widget); |
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3600
diff
changeset
|
313 } |
3600
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
314 event->x = event->x + hs->x; |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
315 event->y = event->y + hs->y; |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3332
diff
changeset
|
316 return FALSE; |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
317 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
318 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
319 return TRUE; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
320 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
321 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
322 static gboolean ui_skinned_horizontal_slider_button_release(GtkWidget *widget, GdkEventButton *event) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
323 UiSkinnedHorizontalSlider *hs = UI_SKINNED_HORIZONTAL_SLIDER(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
324 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
325 |
3724
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3600
diff
changeset
|
326 if (hs->pressed) { |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
327 hs->pressed = FALSE; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
328 g_signal_emit_by_name(widget, "release", priv->position); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
329 gtk_widget_queue_draw(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
330 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
331 return TRUE; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
332 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
333 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
334 static gboolean ui_skinned_horizontal_slider_motion_notify(GtkWidget *widget, GdkEventMotion *event) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
335 g_return_val_if_fail (widget != NULL, FALSE); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
336 g_return_val_if_fail (UI_SKINNED_IS_HORIZONTAL_SLIDER (widget), FALSE); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
337 g_return_val_if_fail (event != NULL, FALSE); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
338 UiSkinnedHorizontalSlider *hs = UI_SKINNED_HORIZONTAL_SLIDER(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
339 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
340 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
341 if (hs->pressed) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
342 gint x; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
343 |
3053
712b3d476e06
Correct slider behaviour in doublesize
Tomasz Mon <desowin@gmail.com>
parents:
3052
diff
changeset
|
344 x = event->x - (priv->knob_width / (priv->double_size ? 1 : 2)); |
712b3d476e06
Correct slider behaviour in doublesize
Tomasz Mon <desowin@gmail.com>
parents:
3052
diff
changeset
|
345 priv->position = x/(1+priv->double_size); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
346 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
347 if (priv->position < priv->min) |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
348 priv->position = priv->min; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
349 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
350 if (priv->position > priv->max) |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
351 priv->position = priv->max; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
352 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
353 if (priv->frame_cb) |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
354 priv->frame = priv->frame_cb(priv->position); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
355 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
356 g_signal_emit_by_name(widget, "motion", priv->position); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
357 gtk_widget_queue_draw(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
358 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
359 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
360 return TRUE; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
361 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
362 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
363 static void ui_skinned_horizontal_slider_toggle_doublesize(UiSkinnedHorizontalSlider *horizontal_slider) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
364 GtkWidget *widget = GTK_WIDGET (horizontal_slider); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
365 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(horizontal_slider); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
366 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
367 priv->double_size = !priv->double_size; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
368 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
369 gtk_widget_set_size_request(widget, priv->width*(1+priv->double_size), priv->height*(1+priv->double_size)); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
370 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
371 gtk_widget_queue_draw(GTK_WIDGET(horizontal_slider)); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
372 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
373 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
374 void ui_skinned_horizontal_slider_set_position(GtkWidget *widget, gint pos) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
375 g_return_if_fail (UI_SKINNED_IS_HORIZONTAL_SLIDER (widget)); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
376 UiSkinnedHorizontalSlider *hs = UI_SKINNED_HORIZONTAL_SLIDER(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
377 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
378 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
379 if (pos == priv->position || hs->pressed) |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
380 return; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
381 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
382 priv->position = pos; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
383 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
384 if (priv->frame_cb) |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
385 priv->frame = priv->frame_cb(priv->position); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
386 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
387 gtk_widget_queue_draw(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
388 } |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
389 |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
390 gint ui_skinned_horizontal_slider_get_position(GtkWidget *widget) { |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
391 g_return_val_if_fail (UI_SKINNED_IS_HORIZONTAL_SLIDER (widget), -1); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
392 UiSkinnedHorizontalSliderPrivate *priv = UI_SKINNED_HORIZONTAL_SLIDER_GET_PRIVATE(widget); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
393 return priv->position; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
394 } |