1
/* Generated by GOB (v2.0.15) (do not edit directly) */
3
/* End world hunger, donate to the World Food Programme, http://www.wfp.org */
5
#define GOB_VERSION_MAJOR 2
6
#define GOB_VERSION_MINOR 0
7
#define GOB_VERSION_PATCHLEVEL 15
9
#define selfp (self->_priv)
11
#include <string.h> /* memset() */
13
#include "lm-line-graph-icon.h"
15
#include "lm-line-graph-icon-private.h"
18
#define ___GOB_LIKELY(expr) G_LIKELY(expr)
19
#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
20
#else /* ! G_LIKELY */
21
#define ___GOB_LIKELY(expr) (expr)
22
#define ___GOB_UNLIKELY(expr) (expr)
25
#line 25 "src/lm-line-graph-icon.gob"
33
#define LINE_WIDTH 3.0
41
static const Point points[] = {
50
#line 51 "lm-line-graph-icon.c"
51
/* self casting macros */
52
#define SELF(x) LM_LINE_GRAPH_ICON(x)
53
#define SELF_CONST(x) LM_LINE_GRAPH_ICON_CONST(x)
54
#define IS_SELF(x) LM_IS_LINE_GRAPH_ICON(x)
55
#define TYPE_SELF LM_TYPE_LINE_GRAPH_ICON
56
#define SELF_CLASS(x) LM_LINE_GRAPH_ICON_CLASS(x)
58
#define SELF_GET_CLASS(x) LM_LINE_GRAPH_ICON_GET_CLASS(x)
61
typedef LMLineGraphIcon Self;
62
typedef LMLineGraphIconClass SelfClass;
64
/* here are local prototypes */
65
static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
66
static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
67
#line 0 "src/lm-line-graph-icon.gob"
68
static void lm_line_graph_icon_init (LMLineGraphIcon * o);
69
#line 70 "lm-line-graph-icon.c"
70
#line 0 "src/lm-line-graph-icon.gob"
71
static void lm_line_graph_icon_class_init (LMLineGraphIconClass * c);
72
#line 73 "lm-line-graph-icon.c"
73
#line 55 "src/lm-line-graph-icon.gob"
74
static void lm_line_graph_icon_constructor (LMLineGraphIcon * self);
75
#line 76 "lm-line-graph-icon.c"
76
#line 64 "src/lm-line-graph-icon.gob"
77
static void ___2_lm_line_graph_icon_size_request (GtkWidget * widget, GtkRequisition * requisition);
78
#line 79 "lm-line-graph-icon.c"
79
#line 76 "src/lm-line-graph-icon.gob"
80
static void lm_line_graph_icon_get_absolute_point (LMLineGraphIcon * self, const Point * in, Point * out);
81
#line 82 "lm-line-graph-icon.c"
82
#line 91 "src/lm-line-graph-icon.gob"
83
static gboolean ___4_lm_line_graph_icon_expose_event (GtkWidget * widget, GdkEventExpose * event);
84
#line 85 "lm-line-graph-icon.c"
91
/* pointer to the class of our parent */
92
static GtkWidgetClass *parent_class = NULL;
94
/* Short form macros */
95
#define self_get_absolute_point lm_line_graph_icon_get_absolute_point
96
#define self_new lm_line_graph_icon_new
98
lm_line_graph_icon_get_type (void)
100
static GType type = 0;
102
if ___GOB_UNLIKELY(type == 0) {
103
static const GTypeInfo info = {
104
sizeof (LMLineGraphIconClass),
105
(GBaseInitFunc) NULL,
106
(GBaseFinalizeFunc) NULL,
107
(GClassInitFunc) lm_line_graph_icon_class_init,
108
(GClassFinalizeFunc) NULL,
109
NULL /* class_data */,
110
sizeof (LMLineGraphIcon),
112
(GInstanceInitFunc) lm_line_graph_icon_init,
116
type = g_type_register_static (GTK_TYPE_WIDGET, "LMLineGraphIcon", &info, (GTypeFlags)0);
122
/* a macro for creating a new object of our type */
123
#define GET_NEW ((LMLineGraphIcon *)g_object_new(lm_line_graph_icon_get_type(), NULL))
125
/* a function for creating a new object of our type */
127
static LMLineGraphIcon * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
128
static LMLineGraphIcon *
129
GET_NEW_VARG (const char *first, ...)
131
LMLineGraphIcon *ret;
133
va_start (ap, first);
134
ret = (LMLineGraphIcon *)g_object_new_valist (lm_line_graph_icon_get_type (), first, ap);
141
___constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties)
143
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::constructor"
145
LMLineGraphIcon *self;
146
obj_self = G_OBJECT_CLASS (parent_class)->constructor (type, n_construct_properties, construct_properties);
147
self = LM_LINE_GRAPH_ICON (obj_self);
148
#line 55 "src/lm-line-graph-icon.gob"
149
lm_line_graph_icon_constructor (self);
150
#line 151 "lm-line-graph-icon.c"
153
#undef __GOB_FUNCTION__
157
___finalize(GObject *obj_self)
159
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::finalize"
160
LMLineGraphIcon *self G_GNUC_UNUSED = LM_LINE_GRAPH_ICON (obj_self);
161
gpointer priv G_GNUC_UNUSED = self->_priv;
162
if(G_OBJECT_CLASS(parent_class)->finalize) \
163
(* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
165
#undef __GOB_FUNCTION__
168
lm_line_graph_icon_init (LMLineGraphIcon * o G_GNUC_UNUSED)
170
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::init"
171
o->_priv = G_TYPE_INSTANCE_GET_PRIVATE(o,LM_TYPE_LINE_GRAPH_ICON,LMLineGraphIconPrivate);
173
#undef __GOB_FUNCTION__
175
lm_line_graph_icon_class_init (LMLineGraphIconClass * c G_GNUC_UNUSED)
177
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::class_init"
178
GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
179
GtkWidgetClass *gtk_widget_class = (GtkWidgetClass *)c;
181
g_type_class_add_private(c,sizeof(LMLineGraphIconPrivate));
183
parent_class = g_type_class_ref (GTK_TYPE_WIDGET);
185
#line 64 "src/lm-line-graph-icon.gob"
186
gtk_widget_class->size_request = ___2_lm_line_graph_icon_size_request;
187
#line 91 "src/lm-line-graph-icon.gob"
188
gtk_widget_class->expose_event = ___4_lm_line_graph_icon_expose_event;
189
#line 190 "lm-line-graph-icon.c"
190
g_object_class->constructor = ___constructor;
191
g_object_class->finalize = ___finalize;
192
g_object_class->get_property = ___object_get_property;
193
g_object_class->set_property = ___object_set_property;
195
GParamSpec *param_spec;
197
param_spec = g_param_spec_pointer
201
(GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
202
g_object_class_install_property (g_object_class,
207
#undef __GOB_FUNCTION__
210
___object_set_property (GObject *object,
212
const GValue *VAL G_GNUC_UNUSED,
213
GParamSpec *pspec G_GNUC_UNUSED)
214
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::set_property"
216
LMLineGraphIcon *self G_GNUC_UNUSED;
218
self = LM_LINE_GRAPH_ICON (object);
220
switch (property_id) {
223
#line 53 "src/lm-line-graph-icon.gob"
224
self->_priv->host = g_value_get_pointer (VAL);
225
#line 226 "lm-line-graph-icon.c"
229
/* Apparently in g++ this is needed, glib is b0rk */
230
#ifndef __PRETTY_FUNCTION__
232
# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
234
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
238
#undef __GOB_FUNCTION__
241
___object_get_property (GObject *object,
243
GValue *VAL G_GNUC_UNUSED,
244
GParamSpec *pspec G_GNUC_UNUSED)
245
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::get_property"
247
LMLineGraphIcon *self G_GNUC_UNUSED;
249
self = LM_LINE_GRAPH_ICON (object);
251
switch (property_id) {
254
#line 53 "src/lm-line-graph-icon.gob"
255
g_value_set_pointer (VAL, self->_priv->host);
256
#line 257 "lm-line-graph-icon.c"
260
/* Apparently in g++ this is needed, glib is b0rk */
261
#ifndef __PRETTY_FUNCTION__
263
# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
265
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
269
#undef __GOB_FUNCTION__
273
#line 55 "src/lm-line-graph-icon.gob"
275
lm_line_graph_icon_constructor (LMLineGraphIcon * self)
277
#line 278 "lm-line-graph-icon.c"
278
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::constructor"
280
#line 56 "src/lm-line-graph-icon.gob"
282
GTK_WIDGET_SET_FLAGS(self, GTK_NO_WINDOW);
284
lm_g_object_connect(self, selfp->host,
285
"swapped-signal::notify::color", gtk_widget_queue_draw, self,
288
#line 289 "lm-line-graph-icon.c"
289
#undef __GOB_FUNCTION__
291
#line 64 "src/lm-line-graph-icon.gob"
293
___2_lm_line_graph_icon_size_request (GtkWidget * widget G_GNUC_UNUSED, GtkRequisition * requisition)
294
#line 295 "lm-line-graph-icon.c"
295
#define PARENT_HANDLER(___widget,___requisition) \
296
{ if(GTK_WIDGET_CLASS(parent_class)->size_request) \
297
(* GTK_WIDGET_CLASS(parent_class)->size_request)(___widget,___requisition); }
299
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::size_request"
301
#line 66 "src/lm-line-graph-icon.gob"
303
requisition->width = WIDTH;
304
requisition->height = HEIGHT;
306
#line 307 "lm-line-graph-icon.c"
307
#undef __GOB_FUNCTION__
308
#undef PARENT_HANDLER
310
#line 76 "src/lm-line-graph-icon.gob"
312
lm_line_graph_icon_get_absolute_point (LMLineGraphIcon * self, const Point * in, Point * out)
314
#line 315 "lm-line-graph-icon.c"
315
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::get_absolute_point"
316
#line 76 "src/lm-line-graph-icon.gob"
317
g_return_if_fail (self != NULL);
318
#line 76 "src/lm-line-graph-icon.gob"
319
g_return_if_fail (LM_IS_LINE_GRAPH_ICON (self));
320
#line 76 "src/lm-line-graph-icon.gob"
321
g_return_if_fail (in != NULL);
322
#line 76 "src/lm-line-graph-icon.gob"
323
g_return_if_fail (out != NULL);
324
#line 325 "lm-line-graph-icon.c"
326
#line 80 "src/lm-line-graph-icon.gob"
328
GtkWidget *widget = GTK_WIDGET(self);
330
out->x = widget->allocation.x
331
+ ((widget->allocation.width - widget->requisition.width) * XALIGN)
332
+ (in->x * widget->requisition.width);
333
out->y = widget->allocation.y
334
+ ((widget->allocation.height - widget->requisition.height) * YALIGN)
335
+ (in->y * widget->requisition.height);
337
#line 338 "lm-line-graph-icon.c"
338
#undef __GOB_FUNCTION__
340
#line 91 "src/lm-line-graph-icon.gob"
342
___4_lm_line_graph_icon_expose_event (GtkWidget * widget G_GNUC_UNUSED, GdkEventExpose * event)
343
#line 344 "lm-line-graph-icon.c"
344
#define PARENT_HANDLER(___widget,___event) \
345
((GTK_WIDGET_CLASS(parent_class)->expose_event)? \
346
(* GTK_WIDGET_CLASS(parent_class)->expose_event)(___widget,___event): \
349
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::expose_event"
351
#line 93 "src/lm-line-graph-icon.gob"
353
Self *self = SELF(widget);
358
if (! GTK_WIDGET_DRAWABLE(widget))
361
cr = gdk_cairo_create(widget->window);
363
gdk_cairo_set_source_color(cr, &selfp->host->color);
365
cairo_set_line_width(cr, LINE_WIDTH);
366
cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT);
367
cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER);
369
self_get_absolute_point(self, &points[0], &p);
370
cairo_move_to(cr, p.x, p.y);
372
for (i = 1; i < G_N_ELEMENTS(points); i++)
374
self_get_absolute_point(self, &points[i], &p);
375
cairo_line_to(cr, p.x, p.y);
384
#line 385 "lm-line-graph-icon.c"
385
#undef __GOB_FUNCTION__
386
#undef PARENT_HANDLER
388
#line 126 "src/lm-line-graph-icon.gob"
390
lm_line_graph_icon_new (LMHostFrontend * host)
392
#line 393 "lm-line-graph-icon.c"
393
#define __GOB_FUNCTION__ "LM:Line:Graph:Icon::new"
394
#line 126 "src/lm-line-graph-icon.gob"
395
g_return_val_if_fail (host != NULL, (GtkWidget * )0);
396
#line 126 "src/lm-line-graph-icon.gob"
397
g_return_val_if_fail (LM_IS_HOST_FRONTEND (host), (GtkWidget * )0);
398
#line 399 "lm-line-graph-icon.c"
400
#line 128 "src/lm-line-graph-icon.gob"
402
return GTK_WIDGET(GET_NEW_VARG(LM_LINE_GRAPH_ICON_PROP_HOST(host), NULL));
404
#line 405 "lm-line-graph-icon.c"
405
#undef __GOB_FUNCTION__