Merge lp:~muktupavels/notify-osd/some-improvements into lp:notify-osd

Proposed by Alberts Muktupāvels
Status: Merged
Approved by: Lars Karlitski
Approved revision: 493
Merged at revision: 487
Proposed branch: lp:~muktupavels/notify-osd/some-improvements
Merge into: lp:notify-osd
Prerequisite: lp:~muktupavels/notify-osd/fix-deprecation-warnings
Diff against target: 835 lines (+103/-111)
1 file modified
src/bubble.c (+103/-111)
To merge this branch: bzr merge lp:~muktupavels/notify-osd/some-improvements
Reviewer Review Type Date Requested Status
Lars Karlitski (community) Approve
Review via email: mp+245283@code.launchpad.net

Commit message

Some improvements:
1) Fix incorrect parameter in widget draw event function.
2) Use G_DEFINE_TYPE_WITH_PRIVATE.

Description of the change

Some improvements:
1) Fix incorrect parameter in widget draw event function.
2) Use G_DEFINE_TYPE_WITH_PRIVATE.

To post a comment you must log in.
Revision history for this message
Lars Karlitski (larsu) wrote :

Great !Thanks for the patch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/bubble.c'
2--- src/bubble.c 2014-12-20 22:08:45 +0000
3+++ src/bubble.c 2014-12-20 22:08:45 +0000
4@@ -51,11 +51,6 @@
5 #include "raico-blur.h"
6 #include "tile.h"
7
8-G_DEFINE_TYPE (Bubble, bubble, G_TYPE_OBJECT);
9-
10-#define GET_PRIVATE(o) \
11- (G_TYPE_INSTANCE_GET_PRIVATE ((o), BUBBLE_TYPE, BubblePrivate))
12-
13 struct _BubblePrivate {
14 BubbleLayout layout;
15 GtkWidget* widget;
16@@ -102,6 +97,8 @@
17 GString* old_icon_filename;
18 };
19
20+G_DEFINE_TYPE_WITH_PRIVATE (Bubble, bubble, G_TYPE_OBJECT);
21+
22 enum
23 {
24 TIMED_OUT,
25@@ -498,7 +495,7 @@
26 static gdouble
27 get_shadow_size (Bubble *bubble)
28 {
29- BubblePrivate* priv = GET_PRIVATE (bubble);
30+ BubblePrivate* priv = bubble->priv;
31 Defaults* d = bubble->defaults;
32 return defaults_get_bubble_shadow_size (d, priv->composited);
33 }
34@@ -506,7 +503,7 @@
35 static gdouble
36 get_corner_radius (Bubble *bubble)
37 {
38- BubblePrivate* priv = GET_PRIVATE (bubble);
39+ BubblePrivate* priv = bubble->priv;
40 Defaults* d = bubble->defaults;
41 return defaults_get_bubble_corner_radius (d, priv->composited);
42 }
43@@ -638,7 +635,7 @@
44 void
45 _refresh_background (Bubble* self)
46 {
47- BubblePrivate* priv = GET_PRIVATE (self);
48+ BubblePrivate* priv = self->priv;
49 Defaults* d = self->defaults;
50 cairo_t* cr = NULL;
51 cairo_surface_t* scratch = NULL;
52@@ -939,7 +936,7 @@
53 void
54 _refresh_icon (Bubble* self)
55 {
56- BubblePrivate* priv = GET_PRIVATE (self);
57+ BubblePrivate* priv = self->priv;
58 Defaults* d = self->defaults;
59 cairo_surface_t* normal = NULL;
60 cairo_t* cr = NULL;
61@@ -991,7 +988,7 @@
62 void
63 _refresh_title (Bubble* self)
64 {
65- BubblePrivate* priv = GET_PRIVATE (self);
66+ BubblePrivate* priv = self->priv;
67 Defaults* d = self->defaults;
68 cairo_surface_t* normal = NULL;
69 cairo_t* cr = NULL;
70@@ -1099,7 +1096,7 @@
71 void
72 _refresh_body (Bubble* self)
73 {
74- BubblePrivate* priv = GET_PRIVATE (self);
75+ BubblePrivate* priv = self->priv;
76 Defaults* d = self->defaults;
77 cairo_surface_t* normal = NULL;
78 cairo_t* cr = NULL;
79@@ -1209,7 +1206,7 @@
80 void
81 _refresh_indicator (Bubble* self)
82 {
83- BubblePrivate* priv = GET_PRIVATE (self);
84+ BubblePrivate* priv = self->priv;
85 Defaults* d = self->defaults;
86 cairo_surface_t* normal = NULL;
87 cairo_t* cr = NULL;
88@@ -1362,7 +1359,7 @@
89 gdouble alpha_normal,
90 gdouble alpha_blur)
91 {
92- BubblePrivate* priv = GET_PRIVATE (self);
93+ BubblePrivate* priv = self->priv;
94 cairo_pattern_t* pattern;
95
96 tile_paint (priv->tile_icon,
97@@ -1432,7 +1429,7 @@
98 gdouble alpha_normal,
99 gdouble alpha_blur)
100 {
101- BubblePrivate* priv = GET_PRIVATE (self);
102+ BubblePrivate* priv = self->priv;
103 cairo_pattern_t* pattern;
104
105 tile_paint (priv->tile_indicator,
106@@ -1533,7 +1530,7 @@
107 _render_body (self,
108 cr,
109 shadow + 2 * margin + 2 * icon_half - BUBBLE_CONTENT_BLUR_RADIUS,
110- shadow + margin + GET_PRIVATE (self)->title_height - BUBBLE_CONTENT_BLUR_RADIUS,
111+ shadow + margin + self->priv->title_height - BUBBLE_CONTENT_BLUR_RADIUS,
112 alpha_normal,
113 alpha_blur);
114 break;
115@@ -1548,7 +1545,7 @@
116 _render_body (self,
117 cr,
118 shadow + margin - BUBBLE_CONTENT_BLUR_RADIUS,
119- shadow + margin + GET_PRIVATE (self)->title_height - BUBBLE_CONTENT_BLUR_RADIUS,
120+ shadow + margin + self->priv->title_height - BUBBLE_CONTENT_BLUR_RADIUS,
121 alpha_normal,
122 alpha_blur);
123 break;
124@@ -1668,7 +1665,7 @@
125 if (!self || !IS_BUBBLE (self))
126 return;
127
128- priv = GET_PRIVATE (self);
129+ priv = self->priv;
130
131 // do we actually need a shape-mask at all?
132 if (priv->composited)
133@@ -1710,33 +1707,30 @@
134 composited_changed_handler (GtkWidget* window,
135 gpointer data)
136 {
137- Bubble* bubble;
138-
139- bubble = (Bubble*) G_OBJECT (data);
140-
141- GET_PRIVATE (bubble)->composited = gdk_screen_is_composited (
142- gtk_widget_get_screen (window));
143+ Bubble* bubble;
144+ BubblePrivate* priv;
145+
146+ bubble = BUBBLE (data);
147+ priv = bubble->priv;
148+
149+ priv->composited = gdk_screen_is_composited (gtk_widget_get_screen (window));
150
151 update_shape (bubble);
152 }
153
154-static
155-gboolean
156-expose_handler (GtkWidget* window,
157- GdkEventExpose* event,
158- gpointer data)
159+static gboolean
160+bubble_draw (GtkWidget* widget,
161+ cairo_t* cr,
162+ gpointer data)
163 {
164 Bubble* bubble;
165- cairo_t* cr;
166 Defaults* d;
167 BubblePrivate* priv;
168
169 bubble = (Bubble*) G_OBJECT (data);
170
171 d = bubble->defaults;
172- priv = GET_PRIVATE (bubble);
173-
174- cr = gdk_cairo_create (gtk_widget_get_window (window));
175+ priv = bubble->priv;
176
177 // clear bubble-background
178 cairo_scale (cr, 1.0f, 1.0f);
179@@ -1767,9 +1761,7 @@
180 1.0f - priv->distance);
181 }
182
183- cairo_destroy (cr);
184-
185- _set_bg_blur (window,
186+ _set_bg_blur (widget,
187 TRUE,
188 EM2PIXELS (get_shadow_size (bubble), d));
189
190@@ -1788,7 +1780,7 @@
191 if (!bubble_is_visible (bubble))
192 return FALSE;
193
194- priv = GET_PRIVATE (bubble);
195+ priv = bubble->priv;
196
197 if (!priv->composited)
198 return TRUE;
199@@ -1897,7 +1889,7 @@
200 if (!bubble_is_visible (bubble))
201 return FALSE;
202
203- priv = GET_PRIVATE (bubble);
204+ priv = bubble->priv;
205 window = priv->widget;
206
207 if (!GTK_IS_WINDOW (window))
208@@ -1976,12 +1968,14 @@
209 static void
210 bubble_dispose (GObject* gobject)
211 {
212+ Bubble* bubble;
213 BubblePrivate* priv;
214
215 if (!gobject || !IS_BUBBLE (gobject))
216 return;
217
218- priv = GET_PRIVATE (gobject);
219+ bubble = BUBBLE (gobject);
220+ priv = bubble->priv;
221
222 if (GTK_IS_WIDGET (priv->widget))
223 {
224@@ -2113,7 +2107,7 @@
225
226 BubblePrivate *priv;
227
228- self->priv = priv = GET_PRIVATE (self);
229+ self->priv = priv = bubble_get_instance_private (self);
230 priv->layout = LAYOUT_NONE;
231 priv->title = NULL;
232 priv->message_body = NULL;
233@@ -2147,8 +2141,6 @@
234 {
235 GObjectClass* gobject_class = G_OBJECT_CLASS (klass);
236
237- g_type_class_add_private (klass, sizeof (BubblePrivate));
238-
239 gobject_class->dispose = bubble_dispose;
240 gobject_class->finalize = bubble_finalize;
241 gobject_class->get_property = bubble_get_property;
242@@ -2216,7 +2208,7 @@
243 return NULL;
244
245 this->defaults = defaults;
246- priv = GET_PRIVATE (this);
247+ priv = this->priv;
248
249 priv->widget = bubble_window_new();
250 window = priv->widget;
251@@ -2255,10 +2247,10 @@
252 &transparent);
253
254 // hook up window-event handlers to window
255- g_signal_connect (G_OBJECT (window),
256- "draw",
257- G_CALLBACK (expose_handler),
258- this);
259+ g_signal_connect (window,
260+ "draw",
261+ G_CALLBACK (bubble_draw),
262+ this);
263
264 // "clear" input-mask, set title/icon/attributes
265 gtk_widget_set_app_paintable (window, TRUE);
266@@ -2271,7 +2263,7 @@
267 gtk_widget_set_opacity (window, 0.0f);
268
269 // TODO: fold some of that back into bubble_init
270- this->priv = GET_PRIVATE (this);
271+ this->priv = this->priv;
272 this->priv->layout = LAYOUT_NONE;
273 this->priv->widget = window;
274 this->priv->title = g_string_new ("");
275@@ -2313,7 +2305,7 @@
276 {
277 g_return_val_if_fail (IS_BUBBLE (self), NULL);
278
279- return GET_PRIVATE (self)->synchronous;
280+ return self->priv->synchronous;
281 }
282
283 gchar*
284@@ -2321,7 +2313,7 @@
285 {
286 g_return_val_if_fail (IS_BUBBLE (self), NULL);
287
288- return GET_PRIVATE (self)->sender;
289+ return self->priv->sender;
290 }
291
292 void
293@@ -2334,7 +2326,7 @@
294 if (!self || !IS_BUBBLE (self))
295 return;
296
297- priv = GET_PRIVATE (self);
298+ priv = self->priv;
299
300 // convert any newline to space
301 text = newline_to_space (title);
302@@ -2350,7 +2342,7 @@
303 priv->title = g_string_new (text);
304
305 g_object_notify (
306- G_OBJECT (gtk_widget_get_accessible (GET_PRIVATE(self)->widget)),
307+ G_OBJECT (gtk_widget_get_accessible (self->priv->widget)),
308 "accessible-name");
309
310 g_free (text);
311@@ -2362,7 +2354,7 @@
312 if (!self || !IS_BUBBLE (self))
313 return NULL;
314
315- return GET_PRIVATE (self)->title->str;
316+ return self->priv->title->str;
317 }
318
319 void
320@@ -2375,7 +2367,7 @@
321 if (!self || !IS_BUBBLE (self))
322 return;
323
324- priv = GET_PRIVATE (self);
325+ priv = self->priv;
326
327 // filter out any HTML/markup if possible
328 text = filter_text (body);
329@@ -2408,7 +2400,7 @@
330 if (!self || !IS_BUBBLE (self))
331 return NULL;
332
333- return GET_PRIVATE (self)->message_body->str;
334+ return self->priv->message_body->str;
335 }
336
337 void
338@@ -2421,7 +2413,7 @@
339 if (!self || !IS_BUBBLE (self) || !g_strcmp0 (filepath, ""))
340 return;
341
342- priv = GET_PRIVATE (self);
343+ priv = self->priv;
344
345 // check if an app tries to set the same file as icon again, this check
346 // avoids superfluous regeneration of the tile/blur-cache for the icon,
347@@ -2458,7 +2450,7 @@
348 if (!self || !IS_BUBBLE (self) || !g_strcmp0 (filename, ""))
349 return;
350
351- priv = GET_PRIVATE (self);
352+ priv = self->priv;
353
354 //basename = g_path_get_basename (filename);
355
356@@ -2565,7 +2557,7 @@
357 if (!self || !IS_BUBBLE (self) || !pixbuf)
358 return;
359
360- priv = GET_PRIVATE (self);
361+ priv = self->priv;
362
363 // "reset" the stored the icon-filename, fixes LP: #451086
364 g_string_assign (priv->old_icon_filename, "\0");
365@@ -2599,7 +2591,7 @@
366 {
367 g_return_val_if_fail (IS_BUBBLE (self), NULL);
368
369- return GET_PRIVATE (self)->icon_pixbuf;
370+ return self->priv->icon_pixbuf;
371 }
372
373 void
374@@ -2611,7 +2603,7 @@
375 if (!self || !IS_BUBBLE (self))
376 return;
377
378- priv = GET_PRIVATE (self);
379+ priv = self->priv;
380
381 // only really cause a refresh (blur, recreating tile-/blur-cache) if
382 // a different value has been set, this helps improve performance when
383@@ -2633,7 +2625,7 @@
384 if (!self || !IS_BUBBLE (self))
385 return -2;
386
387- return GET_PRIVATE (self)->value;
388+ return self->priv->value;
389 }
390
391 void
392@@ -2644,7 +2636,7 @@
393 if (!self || !IS_BUBBLE (self))
394 return;
395
396- gtk_widget_set_size_request (GET_PRIVATE(self)->widget, width, height);
397+ gtk_widget_set_size_request (self->priv->widget, width, height);
398 }
399
400 void
401@@ -2655,7 +2647,7 @@
402 if (!self || !IS_BUBBLE (self))
403 return;
404
405- gtk_widget_get_size_request (GET_PRIVATE(self)->widget, width, height);
406+ gtk_widget_get_size_request (self->priv->widget, width, height);
407 }
408
409 void
410@@ -2665,7 +2657,7 @@
411 if (!self || !IS_BUBBLE (self))
412 return;
413
414- GET_PRIVATE (self)->timeout = timeout;
415+ self->priv->timeout = timeout;
416 }
417
418 /* a timeout of 0 doesn't make much sense now does it, thus 0 indicates an
419@@ -2676,7 +2668,7 @@
420 if (!self || !IS_BUBBLE (self))
421 return 0;
422
423- return GET_PRIVATE(self)->timeout;
424+ return self->priv->timeout;
425 }
426
427 void
428@@ -2686,7 +2678,7 @@
429 if (!self || !IS_BUBBLE (self))
430 return;
431
432- GET_PRIVATE(self)->timer_id = timer_id;
433+ self->priv->timer_id = timer_id;
434 }
435
436 /* a valid GLib timer-id is always > 0, thus 0 indicates an error */
437@@ -2696,7 +2688,7 @@
438 if (!self || !IS_BUBBLE (self))
439 return 0;
440
441- return GET_PRIVATE(self)->timer_id;
442+ return self->priv->timer_id;
443 }
444
445 void
446@@ -2708,7 +2700,7 @@
447 if (!self || !IS_BUBBLE (self))
448 return;
449
450- priv = GET_PRIVATE (self);
451+ priv = self->priv;
452
453 /* did anything change? */
454 if (priv->mouse_over != flag)
455@@ -2737,7 +2729,7 @@
456 if (!self || !IS_BUBBLE (self))
457 return FALSE;
458
459- priv = GET_PRIVATE (self);
460+ priv = self->priv;
461
462 if (priv->prevent_fade)
463 return FALSE;
464@@ -2753,7 +2745,7 @@
465 if (!self || !IS_BUBBLE (self))
466 return;
467
468- gtk_window_move (GTK_WINDOW (GET_PRIVATE (self)->widget), x, y);
469+ gtk_window_move (GTK_WINDOW (self->priv->widget), x, y);
470 }
471
472 static void
473@@ -2764,7 +2756,7 @@
474
475 g_return_if_fail (IS_BUBBLE (bubble));
476
477- priv = GET_PRIVATE (bubble);
478+ priv = bubble->priv;
479
480 /* get rid of the alpha, so that the mouse-over algorithm notices */
481 if (priv->alpha)
482@@ -2799,7 +2791,7 @@
483
484 g_return_if_fail (IS_BUBBLE (self));
485
486- priv = GET_PRIVATE (self);
487+ priv = self->priv;
488
489 timeline = egg_timeline_new_for_duration (msecs);
490 egg_timeline_set_speed (timeline, FPS);
491@@ -2836,7 +2828,7 @@
492 if (!self || !IS_BUBBLE (self))
493 return;
494
495- priv = GET_PRIVATE (self);
496+ priv = self->priv;
497
498 priv->visible = TRUE;
499 gtk_widget_show_all (priv->widget);
500@@ -2869,7 +2861,7 @@
501 return;
502
503 /* force a redraw */
504- gtk_widget_queue_draw (GET_PRIVATE (self)->widget);
505+ gtk_widget_queue_draw (self->priv->widget);
506 }
507
508 static inline gboolean
509@@ -2877,13 +2869,13 @@
510 {
511 /* no g_return_if_fail(), the caller should have already
512 checked that */
513- return gtk_widget_is_composited (GET_PRIVATE (bubble)->widget);
514+ return gtk_widget_is_composited (bubble->priv->widget);
515 }
516
517 static inline GtkWindow*
518 bubble_get_window (Bubble *bubble)
519 {
520- return GTK_WINDOW (GET_PRIVATE (bubble)->widget);
521+ return GTK_WINDOW (bubble->priv->widget);
522 }
523
524 static void
525@@ -2895,15 +2887,15 @@
526
527 g_return_if_fail (IS_BUBBLE (bubble));
528
529- opacity = (float)egg_alpha_get_alpha (GET_PRIVATE (bubble)->alpha)
530+ opacity = (float)egg_alpha_get_alpha (bubble->priv->alpha)
531 / (float)EGG_ALPHA_MAX_ALPHA
532 * WINDOW_MAX_OPACITY;
533
534 if (bubble_is_mouse_over (bubble))
535- gtk_widget_set_opacity (GET_PRIVATE (bubble)->widget,
536+ gtk_widget_set_opacity (bubble->priv->widget,
537 WINDOW_MIN_OPACITY);
538 else
539- gtk_widget_set_opacity (GET_PRIVATE (bubble)->widget, opacity);
540+ gtk_widget_set_opacity (bubble->priv->widget, opacity);
541 }
542
543 static void
544@@ -2929,7 +2921,7 @@
545
546 g_return_if_fail (IS_BUBBLE (bubble));
547
548- priv = GET_PRIVATE (bubble);
549+ priv = bubble->priv;
550
551 /* get rid of the alpha, so that the mouse-over algorithm notices */
552 if (priv->alpha)
553@@ -2945,10 +2937,10 @@
554 }
555
556 if (bubble_is_mouse_over (bubble))
557- gtk_widget_set_opacity (GET_PRIVATE (bubble)->widget,
558+ gtk_widget_set_opacity (bubble->priv->widget,
559 WINDOW_MIN_OPACITY);
560 else
561- gtk_widget_set_opacity (GET_PRIVATE (bubble)->widget,
562+ gtk_widget_set_opacity (bubble->priv->widget,
563 WINDOW_MAX_OPACITY);
564
565 bubble_start_timer (bubble, TRUE);
566@@ -2963,7 +2955,7 @@
567
568 g_return_if_fail (IS_BUBBLE (self));
569
570- priv = GET_PRIVATE (self);
571+ priv = self->priv;
572
573 if (!bubble_is_composited (self)
574 || msecs == 0)
575@@ -2999,7 +2991,7 @@
576
577 egg_timeline_start (timeline);
578
579- gtk_widget_set_opacity (GET_PRIVATE (self)->widget, 0.0f);
580+ gtk_widget_set_opacity (self->priv->widget, 0.0f);
581
582 bubble_show (self);
583 }
584@@ -3013,7 +3005,7 @@
585
586 g_return_if_fail (IS_BUBBLE (self));
587
588- priv = GET_PRIVATE (self);
589+ priv = self->priv;
590
591 timeline = egg_timeline_new_for_duration (msecs);
592 egg_timeline_set_speed (timeline, FPS);
593@@ -3052,7 +3044,7 @@
594 * g_source_remove() on it later. */
595 bubble_set_timer_id (self, 0);
596
597- if (GET_PRIVATE (self)->composited)
598+ if (self->priv->composited)
599 {
600 bubble_fade_out (self, 300);
601 return FALSE;
602@@ -3077,7 +3069,7 @@
603 if (!self || !IS_BUBBLE (self) || !bubble_is_visible (self))
604 return;
605
606- priv = GET_PRIVATE (self);
607+ priv = self->priv;
608
609 priv->visible = FALSE;
610 gtk_widget_hide (priv->widget);
611@@ -3105,7 +3097,7 @@
612 if (!self || !IS_BUBBLE (self))
613 return;
614
615- GET_PRIVATE (self)->id = id;
616+ self->priv->id = id;
617 }
618
619 guint
620@@ -3114,7 +3106,7 @@
621 if (!self || !IS_BUBBLE (self))
622 return 0;
623
624- return GET_PRIVATE (self)->id;
625+ return self->priv->id;
626 }
627
628 gboolean
629@@ -3123,7 +3115,7 @@
630 if (!self || !IS_BUBBLE (self))
631 return FALSE;
632
633- return GET_PRIVATE (self)->visible;
634+ return self->priv->visible;
635 }
636
637 void
638@@ -3136,7 +3128,7 @@
639 if (!self || !IS_BUBBLE (self))
640 return;
641
642- priv = GET_PRIVATE (self);
643+ priv = self->priv;
644
645 timer_id = bubble_get_timer_id (self);
646 if (timer_id > 0)
647@@ -3167,7 +3159,7 @@
648 if (!self || !IS_BUBBLE (self))
649 return;
650
651- timer_id = GET_PRIVATE(self)->timer_id;
652+ timer_id = self->priv->timer_id;
653
654 if (timer_id > 0) {
655 g_source_remove (timer_id);
656@@ -3183,7 +3175,7 @@
657 if (!self || !IS_BUBBLE (self))
658 return;
659
660- gtk_window_get_position (GTK_WINDOW (GET_PRIVATE (self)->widget),
661+ gtk_window_get_position (GTK_WINDOW (self->priv->widget),
662 x, y);
663 }
664
665@@ -3196,7 +3188,7 @@
666 if (!self || !IS_BUBBLE (self))
667 return 0;
668
669- gtk_window_get_size (GTK_WINDOW (GET_PRIVATE (self)->widget),
670+ gtk_window_get_size (GTK_WINDOW (self->priv->widget),
671 &width,
672 &height);
673
674@@ -3209,7 +3201,7 @@
675 if (!self || !IS_BUBBLE (self))
676 return 0;
677
678- return GET_PRIVATE (self)->future_height;
679+ return self->priv->future_height;
680 }
681
682 gint
683@@ -3230,7 +3222,7 @@
684 return 0;
685
686 d = self->defaults;
687- priv = GET_PRIVATE (self);
688+ priv = self->priv;
689
690 surface = cairo_image_surface_create (CAIRO_FORMAT_A1, 1, 1);
691 if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) {
692@@ -3306,7 +3298,7 @@
693 return 0;
694
695 d = self->defaults;
696- priv = GET_PRIVATE (self);
697+ priv = self->priv;
698
699 cr = gdk_cairo_create (gtk_widget_get_window (priv->widget));
700 if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
701@@ -3413,7 +3405,7 @@
702 return;
703
704 d = self->defaults;
705- priv = GET_PRIVATE (self);
706+ priv = self->priv;
707
708 /* FIXME: a quick fix to rescale an icon (e.g. user changed font-size or
709 ** DPI while a bubble is displayed, thus bubble is re-rendered and the
710@@ -3448,7 +3440,7 @@
711
712 priv->title_height = _calc_title_height (
713 self,
714- GET_PRIVATE (self)->title_width);
715+ self->priv->title_width);
716
717 new_bubble_height =
718 EM2PIXELS (defaults_get_bubble_min_height (d), d) +
719@@ -3467,7 +3459,7 @@
720
721 priv->title_height = _calc_title_height (
722 self,
723- GET_PRIVATE (self)->title_width);
724+ self->priv->title_width);
725
726 priv->body_width =
727 EM2PIXELS (defaults_get_bubble_width (d), d) -
728@@ -3610,7 +3602,7 @@
729
730 g_return_if_fail (IS_BUBBLE (self));
731
732- priv = GET_PRIVATE (self);
733+ priv = self->priv;
734
735 if (priv->synchronous != NULL)
736 g_free (priv->synchronous);
737@@ -3626,7 +3618,7 @@
738
739 g_return_if_fail (IS_BUBBLE (self));
740
741- priv = GET_PRIVATE (self);
742+ priv = self->priv;
743
744 if (priv->sender != NULL)
745 g_free (priv->sender);
746@@ -3640,7 +3632,7 @@
747 if (!self || !IS_BUBBLE (self))
748 return FALSE;
749
750- return (GET_PRIVATE (self)->synchronous != NULL);
751+ return (self->priv->synchronous != NULL);
752 }
753
754 gboolean
755@@ -3648,7 +3640,7 @@
756 {
757 g_return_val_if_fail (IS_BUBBLE (self), FALSE);
758
759- return (GET_PRIVATE (self)->urgency == 2);
760+ return (self->priv->urgency == 2);
761 }
762
763 guint
764@@ -3656,7 +3648,7 @@
765 {
766 g_return_val_if_fail (IS_BUBBLE (self), 0);
767
768- return GET_PRIVATE (self)->urgency;
769+ return self->priv->urgency;
770 }
771
772 void
773@@ -3665,7 +3657,7 @@
774 {
775 g_return_if_fail (IS_BUBBLE (self));
776
777- GET_PRIVATE (self)->urgency = urgency;
778+ self->priv->urgency = urgency;
779 }
780
781 void
782@@ -3677,7 +3669,7 @@
783 if (!self || !IS_BUBBLE (self))
784 return;
785
786- priv = GET_PRIVATE (self);
787+ priv = self->priv;
788
789 /* set a sane default */
790 priv->layout = LAYOUT_NONE;
791@@ -3748,7 +3740,7 @@
792 if (!self || !IS_BUBBLE (self))
793 return LAYOUT_NONE;
794
795- return GET_PRIVATE (self)->layout;
796+ return self->priv->layout;
797 }
798
799 void
800@@ -3758,7 +3750,7 @@
801 if (!self || !IS_BUBBLE (self))
802 return;
803
804- GET_PRIVATE (self)->icon_only = allowed;
805+ self->priv->icon_only = allowed;
806 }
807
808 void
809@@ -3768,7 +3760,7 @@
810 if (!self || !IS_BUBBLE (self))
811 return;
812
813- GET_PRIVATE (self)->append = allowed;
814+ self->priv->append = allowed;
815 }
816
817
818@@ -3778,7 +3770,7 @@
819 if (!self || !IS_BUBBLE (self))
820 return FALSE;
821
822- return GET_PRIVATE (self)->append;
823+ return self->priv->append;
824 }
825
826 void
827@@ -3793,7 +3785,7 @@
828 if (!self || !IS_BUBBLE (self) || !append_body)
829 return;
830
831- priv = GET_PRIVATE (self);
832+ priv = self->priv;
833
834 // filter out any HTML/markup if possible
835 result = pango_parse_markup (append_body,

Subscribers

People subscribed via source and target branches