1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
/* ddbseekbar.c generated by valac 0.10.0, the Vala compiler
* generated from ddbseekbar.vala, do not modify */
/*
DeaDBeeF - ultimate music player for GNU/Linux systems with X11
Copyright (C) 2009-2010 Alexey Yakovenko <waker@users.sourceforge.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gtkui.h>
#include <drawing.h>
#define DDB_TYPE_SEEKBAR (ddb_seekbar_get_type ())
#define DDB_SEEKBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DDB_TYPE_SEEKBAR, DdbSeekbar))
#define DDB_SEEKBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DDB_TYPE_SEEKBAR, DdbSeekbarClass))
#define DDB_IS_SEEKBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DDB_TYPE_SEEKBAR))
#define DDB_IS_SEEKBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DDB_TYPE_SEEKBAR))
#define DDB_SEEKBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DDB_TYPE_SEEKBAR, DdbSeekbarClass))
typedef struct _DdbSeekbar DdbSeekbar;
typedef struct _DdbSeekbarClass DdbSeekbarClass;
typedef struct _DdbSeekbarPrivate DdbSeekbarPrivate;
struct _DdbSeekbar {
GtkWidget parent_instance;
DdbSeekbarPrivate * priv;
};
struct _DdbSeekbarClass {
GtkWidgetClass parent_class;
};
static gpointer ddb_seekbar_parent_class = NULL;
GType ddb_seekbar_get_type (void) G_GNUC_CONST;
enum {
DDB_SEEKBAR_DUMMY_PROPERTY
};
static void ddb_seekbar_real_realize (GtkWidget* base);
static void ddb_seekbar_real_unrealize (GtkWidget* base);
static void ddb_seekbar_real_size_request (GtkWidget* base, GtkRequisition* requisition);
static gboolean ddb_seekbar_real_expose_event (GtkWidget* base, GdkEventExpose* event);
static gboolean ddb_seekbar_real_button_press_event (GtkWidget* base, GdkEventButton* event);
static gboolean ddb_seekbar_real_button_release_event (GtkWidget* base, GdkEventButton* event);
static gboolean ddb_seekbar_real_motion_notify_event (GtkWidget* base, GdkEventMotion* event);
static gboolean ddb_seekbar_real_configure_event (GtkWidget* base, GdkEventConfigure* event);
DdbSeekbar* ddb_seekbar_new (void);
DdbSeekbar* ddb_seekbar_construct (GType object_type);
static GObject * ddb_seekbar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void ddb_seekbar_real_realize (GtkWidget* base) {
DdbSeekbar * self;
self = (DdbSeekbar*) base;
gtk_widget_set_has_window ((GtkWidget*) self, FALSE);
GTK_WIDGET_CLASS (ddb_seekbar_parent_class)->realize (GTK_WIDGET (self));
}
static void ddb_seekbar_real_unrealize (GtkWidget* base) {
DdbSeekbar * self;
self = (DdbSeekbar*) base;
GTK_WIDGET_CLASS (ddb_seekbar_parent_class)->unrealize (GTK_WIDGET (self));
}
static void ddb_seekbar_real_size_request (GtkWidget* base, GtkRequisition* requisition) {
DdbSeekbar * self;
self = (DdbSeekbar*) base;
}
static gboolean ddb_seekbar_real_expose_event (GtkWidget* base, GdkEventExpose* event) {
DdbSeekbar * self;
gboolean result = FALSE;
self = (DdbSeekbar*) base;
seekbar_draw (GTK_WIDGET (self));
result = TRUE;
return result;
}
static gboolean ddb_seekbar_real_button_press_event (GtkWidget* base, GdkEventButton* event) {
DdbSeekbar * self;
gboolean result = FALSE;
self = (DdbSeekbar*) base;
result = on_seekbar_button_press_event ((GtkWidget*) self, event);
return result;
}
static gboolean ddb_seekbar_real_button_release_event (GtkWidget* base, GdkEventButton* event) {
DdbSeekbar * self;
gboolean result = FALSE;
self = (DdbSeekbar*) base;
result = on_seekbar_button_release_event ((GtkWidget*) self, event);
return result;
}
static gboolean ddb_seekbar_real_motion_notify_event (GtkWidget* base, GdkEventMotion* event) {
DdbSeekbar * self;
gboolean result = FALSE;
self = (DdbSeekbar*) base;
result = on_seekbar_motion_notify_event ((GtkWidget*) self, event);
return result;
}
static gboolean ddb_seekbar_real_configure_event (GtkWidget* base, GdkEventConfigure* event) {
DdbSeekbar * self;
gboolean result = FALSE;
self = (DdbSeekbar*) base;
gtkui_init_theme_colors ();
result = FALSE;
return result;
}
DdbSeekbar* ddb_seekbar_construct (GType object_type) {
DdbSeekbar * self;
self = (DdbSeekbar*) gtk_widget_new (object_type, NULL);
return self;
}
DdbSeekbar* ddb_seekbar_new (void) {
return ddb_seekbar_construct (DDB_TYPE_SEEKBAR);
}
static GObject * ddb_seekbar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
GObject * obj;
GObjectClass * parent_class;
DdbSeekbar * self;
parent_class = G_OBJECT_CLASS (ddb_seekbar_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = DDB_SEEKBAR (obj);
{
}
return obj;
}
static void ddb_seekbar_class_init (DdbSeekbarClass * klass) {
ddb_seekbar_parent_class = g_type_class_peek_parent (klass);
GTK_WIDGET_CLASS (klass)->realize = ddb_seekbar_real_realize;
GTK_WIDGET_CLASS (klass)->unrealize = ddb_seekbar_real_unrealize;
GTK_WIDGET_CLASS (klass)->size_request = ddb_seekbar_real_size_request;
GTK_WIDGET_CLASS (klass)->expose_event = ddb_seekbar_real_expose_event;
GTK_WIDGET_CLASS (klass)->button_press_event = ddb_seekbar_real_button_press_event;
GTK_WIDGET_CLASS (klass)->button_release_event = ddb_seekbar_real_button_release_event;
GTK_WIDGET_CLASS (klass)->motion_notify_event = ddb_seekbar_real_motion_notify_event;
GTK_WIDGET_CLASS (klass)->configure_event = ddb_seekbar_real_configure_event;
G_OBJECT_CLASS (klass)->constructor = ddb_seekbar_constructor;
}
static void ddb_seekbar_instance_init (DdbSeekbar * self) {
}
GType ddb_seekbar_get_type (void) {
static volatile gsize ddb_seekbar_type_id__volatile = 0;
if (g_once_init_enter (&ddb_seekbar_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (DdbSeekbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ddb_seekbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DdbSeekbar), 0, (GInstanceInitFunc) ddb_seekbar_instance_init, NULL };
GType ddb_seekbar_type_id;
ddb_seekbar_type_id = g_type_register_static (GTK_TYPE_WIDGET, "DdbSeekbar", &g_define_type_info, 0);
g_once_init_leave (&ddb_seekbar_type_id__volatile, ddb_seekbar_type_id);
}
return ddb_seekbar_type_id__volatile;
}
|