Merge lp:~muktupavels/notify-osd/some-improvements into lp:notify-osd
- some-improvements
- Merge into trunk
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 |
Related bugs: |
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_
Description of the change
Some improvements:
1) Fix incorrect parameter in widget draw event function.
2) Use G_DEFINE_
To post a comment you must log in.
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 | 51 | #include "raico-blur.h" | 51 | #include "raico-blur.h" |
6 | 52 | #include "tile.h" | 52 | #include "tile.h" |
7 | 53 | 53 | ||
8 | 54 | G_DEFINE_TYPE (Bubble, bubble, G_TYPE_OBJECT); | ||
9 | 55 | |||
10 | 56 | #define GET_PRIVATE(o) \ | ||
11 | 57 | (G_TYPE_INSTANCE_GET_PRIVATE ((o), BUBBLE_TYPE, BubblePrivate)) | ||
12 | 58 | |||
13 | 59 | struct _BubblePrivate { | 54 | struct _BubblePrivate { |
14 | 60 | BubbleLayout layout; | 55 | BubbleLayout layout; |
15 | 61 | GtkWidget* widget; | 56 | GtkWidget* widget; |
16 | @@ -102,6 +97,8 @@ | |||
17 | 102 | GString* old_icon_filename; | 97 | GString* old_icon_filename; |
18 | 103 | }; | 98 | }; |
19 | 104 | 99 | ||
20 | 100 | G_DEFINE_TYPE_WITH_PRIVATE (Bubble, bubble, G_TYPE_OBJECT); | ||
21 | 101 | |||
22 | 105 | enum | 102 | enum |
23 | 106 | { | 103 | { |
24 | 107 | TIMED_OUT, | 104 | TIMED_OUT, |
25 | @@ -498,7 +495,7 @@ | |||
26 | 498 | static gdouble | 495 | static gdouble |
27 | 499 | get_shadow_size (Bubble *bubble) | 496 | get_shadow_size (Bubble *bubble) |
28 | 500 | { | 497 | { |
30 | 501 | BubblePrivate* priv = GET_PRIVATE (bubble); | 498 | BubblePrivate* priv = bubble->priv; |
31 | 502 | Defaults* d = bubble->defaults; | 499 | Defaults* d = bubble->defaults; |
32 | 503 | return defaults_get_bubble_shadow_size (d, priv->composited); | 500 | return defaults_get_bubble_shadow_size (d, priv->composited); |
33 | 504 | } | 501 | } |
34 | @@ -506,7 +503,7 @@ | |||
35 | 506 | static gdouble | 503 | static gdouble |
36 | 507 | get_corner_radius (Bubble *bubble) | 504 | get_corner_radius (Bubble *bubble) |
37 | 508 | { | 505 | { |
39 | 509 | BubblePrivate* priv = GET_PRIVATE (bubble); | 506 | BubblePrivate* priv = bubble->priv; |
40 | 510 | Defaults* d = bubble->defaults; | 507 | Defaults* d = bubble->defaults; |
41 | 511 | return defaults_get_bubble_corner_radius (d, priv->composited); | 508 | return defaults_get_bubble_corner_radius (d, priv->composited); |
42 | 512 | } | 509 | } |
43 | @@ -638,7 +635,7 @@ | |||
44 | 638 | void | 635 | void |
45 | 639 | _refresh_background (Bubble* self) | 636 | _refresh_background (Bubble* self) |
46 | 640 | { | 637 | { |
48 | 641 | BubblePrivate* priv = GET_PRIVATE (self); | 638 | BubblePrivate* priv = self->priv; |
49 | 642 | Defaults* d = self->defaults; | 639 | Defaults* d = self->defaults; |
50 | 643 | cairo_t* cr = NULL; | 640 | cairo_t* cr = NULL; |
51 | 644 | cairo_surface_t* scratch = NULL; | 641 | cairo_surface_t* scratch = NULL; |
52 | @@ -939,7 +936,7 @@ | |||
53 | 939 | void | 936 | void |
54 | 940 | _refresh_icon (Bubble* self) | 937 | _refresh_icon (Bubble* self) |
55 | 941 | { | 938 | { |
57 | 942 | BubblePrivate* priv = GET_PRIVATE (self); | 939 | BubblePrivate* priv = self->priv; |
58 | 943 | Defaults* d = self->defaults; | 940 | Defaults* d = self->defaults; |
59 | 944 | cairo_surface_t* normal = NULL; | 941 | cairo_surface_t* normal = NULL; |
60 | 945 | cairo_t* cr = NULL; | 942 | cairo_t* cr = NULL; |
61 | @@ -991,7 +988,7 @@ | |||
62 | 991 | void | 988 | void |
63 | 992 | _refresh_title (Bubble* self) | 989 | _refresh_title (Bubble* self) |
64 | 993 | { | 990 | { |
66 | 994 | BubblePrivate* priv = GET_PRIVATE (self); | 991 | BubblePrivate* priv = self->priv; |
67 | 995 | Defaults* d = self->defaults; | 992 | Defaults* d = self->defaults; |
68 | 996 | cairo_surface_t* normal = NULL; | 993 | cairo_surface_t* normal = NULL; |
69 | 997 | cairo_t* cr = NULL; | 994 | cairo_t* cr = NULL; |
70 | @@ -1099,7 +1096,7 @@ | |||
71 | 1099 | void | 1096 | void |
72 | 1100 | _refresh_body (Bubble* self) | 1097 | _refresh_body (Bubble* self) |
73 | 1101 | { | 1098 | { |
75 | 1102 | BubblePrivate* priv = GET_PRIVATE (self); | 1099 | BubblePrivate* priv = self->priv; |
76 | 1103 | Defaults* d = self->defaults; | 1100 | Defaults* d = self->defaults; |
77 | 1104 | cairo_surface_t* normal = NULL; | 1101 | cairo_surface_t* normal = NULL; |
78 | 1105 | cairo_t* cr = NULL; | 1102 | cairo_t* cr = NULL; |
79 | @@ -1209,7 +1206,7 @@ | |||
80 | 1209 | void | 1206 | void |
81 | 1210 | _refresh_indicator (Bubble* self) | 1207 | _refresh_indicator (Bubble* self) |
82 | 1211 | { | 1208 | { |
84 | 1212 | BubblePrivate* priv = GET_PRIVATE (self); | 1209 | BubblePrivate* priv = self->priv; |
85 | 1213 | Defaults* d = self->defaults; | 1210 | Defaults* d = self->defaults; |
86 | 1214 | cairo_surface_t* normal = NULL; | 1211 | cairo_surface_t* normal = NULL; |
87 | 1215 | cairo_t* cr = NULL; | 1212 | cairo_t* cr = NULL; |
88 | @@ -1362,7 +1359,7 @@ | |||
89 | 1362 | gdouble alpha_normal, | 1359 | gdouble alpha_normal, |
90 | 1363 | gdouble alpha_blur) | 1360 | gdouble alpha_blur) |
91 | 1364 | { | 1361 | { |
93 | 1365 | BubblePrivate* priv = GET_PRIVATE (self); | 1362 | BubblePrivate* priv = self->priv; |
94 | 1366 | cairo_pattern_t* pattern; | 1363 | cairo_pattern_t* pattern; |
95 | 1367 | 1364 | ||
96 | 1368 | tile_paint (priv->tile_icon, | 1365 | tile_paint (priv->tile_icon, |
97 | @@ -1432,7 +1429,7 @@ | |||
98 | 1432 | gdouble alpha_normal, | 1429 | gdouble alpha_normal, |
99 | 1433 | gdouble alpha_blur) | 1430 | gdouble alpha_blur) |
100 | 1434 | { | 1431 | { |
102 | 1435 | BubblePrivate* priv = GET_PRIVATE (self); | 1432 | BubblePrivate* priv = self->priv; |
103 | 1436 | cairo_pattern_t* pattern; | 1433 | cairo_pattern_t* pattern; |
104 | 1437 | 1434 | ||
105 | 1438 | tile_paint (priv->tile_indicator, | 1435 | tile_paint (priv->tile_indicator, |
106 | @@ -1533,7 +1530,7 @@ | |||
107 | 1533 | _render_body (self, | 1530 | _render_body (self, |
108 | 1534 | cr, | 1531 | cr, |
109 | 1535 | shadow + 2 * margin + 2 * icon_half - BUBBLE_CONTENT_BLUR_RADIUS, | 1532 | shadow + 2 * margin + 2 * icon_half - BUBBLE_CONTENT_BLUR_RADIUS, |
111 | 1536 | shadow + margin + GET_PRIVATE (self)->title_height - BUBBLE_CONTENT_BLUR_RADIUS, | 1533 | shadow + margin + self->priv->title_height - BUBBLE_CONTENT_BLUR_RADIUS, |
112 | 1537 | alpha_normal, | 1534 | alpha_normal, |
113 | 1538 | alpha_blur); | 1535 | alpha_blur); |
114 | 1539 | break; | 1536 | break; |
115 | @@ -1548,7 +1545,7 @@ | |||
116 | 1548 | _render_body (self, | 1545 | _render_body (self, |
117 | 1549 | cr, | 1546 | cr, |
118 | 1550 | shadow + margin - BUBBLE_CONTENT_BLUR_RADIUS, | 1547 | shadow + margin - BUBBLE_CONTENT_BLUR_RADIUS, |
120 | 1551 | shadow + margin + GET_PRIVATE (self)->title_height - BUBBLE_CONTENT_BLUR_RADIUS, | 1548 | shadow + margin + self->priv->title_height - BUBBLE_CONTENT_BLUR_RADIUS, |
121 | 1552 | alpha_normal, | 1549 | alpha_normal, |
122 | 1553 | alpha_blur); | 1550 | alpha_blur); |
123 | 1554 | break; | 1551 | break; |
124 | @@ -1668,7 +1665,7 @@ | |||
125 | 1668 | if (!self || !IS_BUBBLE (self)) | 1665 | if (!self || !IS_BUBBLE (self)) |
126 | 1669 | return; | 1666 | return; |
127 | 1670 | 1667 | ||
129 | 1671 | priv = GET_PRIVATE (self); | 1668 | priv = self->priv; |
130 | 1672 | 1669 | ||
131 | 1673 | // do we actually need a shape-mask at all? | 1670 | // do we actually need a shape-mask at all? |
132 | 1674 | if (priv->composited) | 1671 | if (priv->composited) |
133 | @@ -1710,33 +1707,30 @@ | |||
134 | 1710 | composited_changed_handler (GtkWidget* window, | 1707 | composited_changed_handler (GtkWidget* window, |
135 | 1711 | gpointer data) | 1708 | gpointer data) |
136 | 1712 | { | 1709 | { |
143 | 1713 | Bubble* bubble; | 1710 | Bubble* bubble; |
144 | 1714 | 1711 | BubblePrivate* priv; | |
145 | 1715 | bubble = (Bubble*) G_OBJECT (data); | 1712 | |
146 | 1716 | 1713 | bubble = BUBBLE (data); | |
147 | 1717 | GET_PRIVATE (bubble)->composited = gdk_screen_is_composited ( | 1714 | priv = bubble->priv; |
148 | 1718 | gtk_widget_get_screen (window)); | 1715 | |
149 | 1716 | priv->composited = gdk_screen_is_composited (gtk_widget_get_screen (window)); | ||
150 | 1719 | 1717 | ||
151 | 1720 | update_shape (bubble); | 1718 | update_shape (bubble); |
152 | 1721 | } | 1719 | } |
153 | 1722 | 1720 | ||
159 | 1723 | static | 1721 | static gboolean |
160 | 1724 | gboolean | 1722 | bubble_draw (GtkWidget* widget, |
161 | 1725 | expose_handler (GtkWidget* window, | 1723 | cairo_t* cr, |
162 | 1726 | GdkEventExpose* event, | 1724 | gpointer data) |
158 | 1727 | gpointer data) | ||
163 | 1728 | { | 1725 | { |
164 | 1729 | Bubble* bubble; | 1726 | Bubble* bubble; |
165 | 1730 | cairo_t* cr; | ||
166 | 1731 | Defaults* d; | 1727 | Defaults* d; |
167 | 1732 | BubblePrivate* priv; | 1728 | BubblePrivate* priv; |
168 | 1733 | 1729 | ||
169 | 1734 | bubble = (Bubble*) G_OBJECT (data); | 1730 | bubble = (Bubble*) G_OBJECT (data); |
170 | 1735 | 1731 | ||
171 | 1736 | d = bubble->defaults; | 1732 | d = bubble->defaults; |
175 | 1737 | priv = GET_PRIVATE (bubble); | 1733 | priv = bubble->priv; |
173 | 1738 | |||
174 | 1739 | cr = gdk_cairo_create (gtk_widget_get_window (window)); | ||
176 | 1740 | 1734 | ||
177 | 1741 | // clear bubble-background | 1735 | // clear bubble-background |
178 | 1742 | cairo_scale (cr, 1.0f, 1.0f); | 1736 | cairo_scale (cr, 1.0f, 1.0f); |
179 | @@ -1767,9 +1761,7 @@ | |||
180 | 1767 | 1.0f - priv->distance); | 1761 | 1.0f - priv->distance); |
181 | 1768 | } | 1762 | } |
182 | 1769 | 1763 | ||
186 | 1770 | cairo_destroy (cr); | 1764 | _set_bg_blur (widget, |
184 | 1771 | |||
185 | 1772 | _set_bg_blur (window, | ||
187 | 1773 | TRUE, | 1765 | TRUE, |
188 | 1774 | EM2PIXELS (get_shadow_size (bubble), d)); | 1766 | EM2PIXELS (get_shadow_size (bubble), d)); |
189 | 1775 | 1767 | ||
190 | @@ -1788,7 +1780,7 @@ | |||
191 | 1788 | if (!bubble_is_visible (bubble)) | 1780 | if (!bubble_is_visible (bubble)) |
192 | 1789 | return FALSE; | 1781 | return FALSE; |
193 | 1790 | 1782 | ||
195 | 1791 | priv = GET_PRIVATE (bubble); | 1783 | priv = bubble->priv; |
196 | 1792 | 1784 | ||
197 | 1793 | if (!priv->composited) | 1785 | if (!priv->composited) |
198 | 1794 | return TRUE; | 1786 | return TRUE; |
199 | @@ -1897,7 +1889,7 @@ | |||
200 | 1897 | if (!bubble_is_visible (bubble)) | 1889 | if (!bubble_is_visible (bubble)) |
201 | 1898 | return FALSE; | 1890 | return FALSE; |
202 | 1899 | 1891 | ||
204 | 1900 | priv = GET_PRIVATE (bubble); | 1892 | priv = bubble->priv; |
205 | 1901 | window = priv->widget; | 1893 | window = priv->widget; |
206 | 1902 | 1894 | ||
207 | 1903 | if (!GTK_IS_WINDOW (window)) | 1895 | if (!GTK_IS_WINDOW (window)) |
208 | @@ -1976,12 +1968,14 @@ | |||
209 | 1976 | static void | 1968 | static void |
210 | 1977 | bubble_dispose (GObject* gobject) | 1969 | bubble_dispose (GObject* gobject) |
211 | 1978 | { | 1970 | { |
212 | 1971 | Bubble* bubble; | ||
213 | 1979 | BubblePrivate* priv; | 1972 | BubblePrivate* priv; |
214 | 1980 | 1973 | ||
215 | 1981 | if (!gobject || !IS_BUBBLE (gobject)) | 1974 | if (!gobject || !IS_BUBBLE (gobject)) |
216 | 1982 | return; | 1975 | return; |
217 | 1983 | 1976 | ||
219 | 1984 | priv = GET_PRIVATE (gobject); | 1977 | bubble = BUBBLE (gobject); |
220 | 1978 | priv = bubble->priv; | ||
221 | 1985 | 1979 | ||
222 | 1986 | if (GTK_IS_WIDGET (priv->widget)) | 1980 | if (GTK_IS_WIDGET (priv->widget)) |
223 | 1987 | { | 1981 | { |
224 | @@ -2113,7 +2107,7 @@ | |||
225 | 2113 | 2107 | ||
226 | 2114 | BubblePrivate *priv; | 2108 | BubblePrivate *priv; |
227 | 2115 | 2109 | ||
229 | 2116 | self->priv = priv = GET_PRIVATE (self); | 2110 | self->priv = priv = bubble_get_instance_private (self); |
230 | 2117 | priv->layout = LAYOUT_NONE; | 2111 | priv->layout = LAYOUT_NONE; |
231 | 2118 | priv->title = NULL; | 2112 | priv->title = NULL; |
232 | 2119 | priv->message_body = NULL; | 2113 | priv->message_body = NULL; |
233 | @@ -2147,8 +2141,6 @@ | |||
234 | 2147 | { | 2141 | { |
235 | 2148 | GObjectClass* gobject_class = G_OBJECT_CLASS (klass); | 2142 | GObjectClass* gobject_class = G_OBJECT_CLASS (klass); |
236 | 2149 | 2143 | ||
237 | 2150 | g_type_class_add_private (klass, sizeof (BubblePrivate)); | ||
238 | 2151 | |||
239 | 2152 | gobject_class->dispose = bubble_dispose; | 2144 | gobject_class->dispose = bubble_dispose; |
240 | 2153 | gobject_class->finalize = bubble_finalize; | 2145 | gobject_class->finalize = bubble_finalize; |
241 | 2154 | gobject_class->get_property = bubble_get_property; | 2146 | gobject_class->get_property = bubble_get_property; |
242 | @@ -2216,7 +2208,7 @@ | |||
243 | 2216 | return NULL; | 2208 | return NULL; |
244 | 2217 | 2209 | ||
245 | 2218 | this->defaults = defaults; | 2210 | this->defaults = defaults; |
247 | 2219 | priv = GET_PRIVATE (this); | 2211 | priv = this->priv; |
248 | 2220 | 2212 | ||
249 | 2221 | priv->widget = bubble_window_new(); | 2213 | priv->widget = bubble_window_new(); |
250 | 2222 | window = priv->widget; | 2214 | window = priv->widget; |
251 | @@ -2255,10 +2247,10 @@ | |||
252 | 2255 | &transparent); | 2247 | &transparent); |
253 | 2256 | 2248 | ||
254 | 2257 | // hook up window-event handlers to window | 2249 | // hook up window-event handlers to window |
259 | 2258 | g_signal_connect (G_OBJECT (window), | 2250 | g_signal_connect (window, |
260 | 2259 | "draw", | 2251 | "draw", |
261 | 2260 | G_CALLBACK (expose_handler), | 2252 | G_CALLBACK (bubble_draw), |
262 | 2261 | this); | 2253 | this); |
263 | 2262 | 2254 | ||
264 | 2263 | // "clear" input-mask, set title/icon/attributes | 2255 | // "clear" input-mask, set title/icon/attributes |
265 | 2264 | gtk_widget_set_app_paintable (window, TRUE); | 2256 | gtk_widget_set_app_paintable (window, TRUE); |
266 | @@ -2271,7 +2263,7 @@ | |||
267 | 2271 | gtk_widget_set_opacity (window, 0.0f); | 2263 | gtk_widget_set_opacity (window, 0.0f); |
268 | 2272 | 2264 | ||
269 | 2273 | // TODO: fold some of that back into bubble_init | 2265 | // TODO: fold some of that back into bubble_init |
271 | 2274 | this->priv = GET_PRIVATE (this); | 2266 | this->priv = this->priv; |
272 | 2275 | this->priv->layout = LAYOUT_NONE; | 2267 | this->priv->layout = LAYOUT_NONE; |
273 | 2276 | this->priv->widget = window; | 2268 | this->priv->widget = window; |
274 | 2277 | this->priv->title = g_string_new (""); | 2269 | this->priv->title = g_string_new (""); |
275 | @@ -2313,7 +2305,7 @@ | |||
276 | 2313 | { | 2305 | { |
277 | 2314 | g_return_val_if_fail (IS_BUBBLE (self), NULL); | 2306 | g_return_val_if_fail (IS_BUBBLE (self), NULL); |
278 | 2315 | 2307 | ||
280 | 2316 | return GET_PRIVATE (self)->synchronous; | 2308 | return self->priv->synchronous; |
281 | 2317 | } | 2309 | } |
282 | 2318 | 2310 | ||
283 | 2319 | gchar* | 2311 | gchar* |
284 | @@ -2321,7 +2313,7 @@ | |||
285 | 2321 | { | 2313 | { |
286 | 2322 | g_return_val_if_fail (IS_BUBBLE (self), NULL); | 2314 | g_return_val_if_fail (IS_BUBBLE (self), NULL); |
287 | 2323 | 2315 | ||
289 | 2324 | return GET_PRIVATE (self)->sender; | 2316 | return self->priv->sender; |
290 | 2325 | } | 2317 | } |
291 | 2326 | 2318 | ||
292 | 2327 | void | 2319 | void |
293 | @@ -2334,7 +2326,7 @@ | |||
294 | 2334 | if (!self || !IS_BUBBLE (self)) | 2326 | if (!self || !IS_BUBBLE (self)) |
295 | 2335 | return; | 2327 | return; |
296 | 2336 | 2328 | ||
298 | 2337 | priv = GET_PRIVATE (self); | 2329 | priv = self->priv; |
299 | 2338 | 2330 | ||
300 | 2339 | // convert any newline to space | 2331 | // convert any newline to space |
301 | 2340 | text = newline_to_space (title); | 2332 | text = newline_to_space (title); |
302 | @@ -2350,7 +2342,7 @@ | |||
303 | 2350 | priv->title = g_string_new (text); | 2342 | priv->title = g_string_new (text); |
304 | 2351 | 2343 | ||
305 | 2352 | g_object_notify ( | 2344 | g_object_notify ( |
307 | 2353 | G_OBJECT (gtk_widget_get_accessible (GET_PRIVATE(self)->widget)), | 2345 | G_OBJECT (gtk_widget_get_accessible (self->priv->widget)), |
308 | 2354 | "accessible-name"); | 2346 | "accessible-name"); |
309 | 2355 | 2347 | ||
310 | 2356 | g_free (text); | 2348 | g_free (text); |
311 | @@ -2362,7 +2354,7 @@ | |||
312 | 2362 | if (!self || !IS_BUBBLE (self)) | 2354 | if (!self || !IS_BUBBLE (self)) |
313 | 2363 | return NULL; | 2355 | return NULL; |
314 | 2364 | 2356 | ||
316 | 2365 | return GET_PRIVATE (self)->title->str; | 2357 | return self->priv->title->str; |
317 | 2366 | } | 2358 | } |
318 | 2367 | 2359 | ||
319 | 2368 | void | 2360 | void |
320 | @@ -2375,7 +2367,7 @@ | |||
321 | 2375 | if (!self || !IS_BUBBLE (self)) | 2367 | if (!self || !IS_BUBBLE (self)) |
322 | 2376 | return; | 2368 | return; |
323 | 2377 | 2369 | ||
325 | 2378 | priv = GET_PRIVATE (self); | 2370 | priv = self->priv; |
326 | 2379 | 2371 | ||
327 | 2380 | // filter out any HTML/markup if possible | 2372 | // filter out any HTML/markup if possible |
328 | 2381 | text = filter_text (body); | 2373 | text = filter_text (body); |
329 | @@ -2408,7 +2400,7 @@ | |||
330 | 2408 | if (!self || !IS_BUBBLE (self)) | 2400 | if (!self || !IS_BUBBLE (self)) |
331 | 2409 | return NULL; | 2401 | return NULL; |
332 | 2410 | 2402 | ||
334 | 2411 | return GET_PRIVATE (self)->message_body->str; | 2403 | return self->priv->message_body->str; |
335 | 2412 | } | 2404 | } |
336 | 2413 | 2405 | ||
337 | 2414 | void | 2406 | void |
338 | @@ -2421,7 +2413,7 @@ | |||
339 | 2421 | if (!self || !IS_BUBBLE (self) || !g_strcmp0 (filepath, "")) | 2413 | if (!self || !IS_BUBBLE (self) || !g_strcmp0 (filepath, "")) |
340 | 2422 | return; | 2414 | return; |
341 | 2423 | 2415 | ||
343 | 2424 | priv = GET_PRIVATE (self); | 2416 | priv = self->priv; |
344 | 2425 | 2417 | ||
345 | 2426 | // check if an app tries to set the same file as icon again, this check | 2418 | // check if an app tries to set the same file as icon again, this check |
346 | 2427 | // avoids superfluous regeneration of the tile/blur-cache for the icon, | 2419 | // avoids superfluous regeneration of the tile/blur-cache for the icon, |
347 | @@ -2458,7 +2450,7 @@ | |||
348 | 2458 | if (!self || !IS_BUBBLE (self) || !g_strcmp0 (filename, "")) | 2450 | if (!self || !IS_BUBBLE (self) || !g_strcmp0 (filename, "")) |
349 | 2459 | return; | 2451 | return; |
350 | 2460 | 2452 | ||
352 | 2461 | priv = GET_PRIVATE (self); | 2453 | priv = self->priv; |
353 | 2462 | 2454 | ||
354 | 2463 | //basename = g_path_get_basename (filename); | 2455 | //basename = g_path_get_basename (filename); |
355 | 2464 | 2456 | ||
356 | @@ -2565,7 +2557,7 @@ | |||
357 | 2565 | if (!self || !IS_BUBBLE (self) || !pixbuf) | 2557 | if (!self || !IS_BUBBLE (self) || !pixbuf) |
358 | 2566 | return; | 2558 | return; |
359 | 2567 | 2559 | ||
361 | 2568 | priv = GET_PRIVATE (self); | 2560 | priv = self->priv; |
362 | 2569 | 2561 | ||
363 | 2570 | // "reset" the stored the icon-filename, fixes LP: #451086 | 2562 | // "reset" the stored the icon-filename, fixes LP: #451086 |
364 | 2571 | g_string_assign (priv->old_icon_filename, "\0"); | 2563 | g_string_assign (priv->old_icon_filename, "\0"); |
365 | @@ -2599,7 +2591,7 @@ | |||
366 | 2599 | { | 2591 | { |
367 | 2600 | g_return_val_if_fail (IS_BUBBLE (self), NULL); | 2592 | g_return_val_if_fail (IS_BUBBLE (self), NULL); |
368 | 2601 | 2593 | ||
370 | 2602 | return GET_PRIVATE (self)->icon_pixbuf; | 2594 | return self->priv->icon_pixbuf; |
371 | 2603 | } | 2595 | } |
372 | 2604 | 2596 | ||
373 | 2605 | void | 2597 | void |
374 | @@ -2611,7 +2603,7 @@ | |||
375 | 2611 | if (!self || !IS_BUBBLE (self)) | 2603 | if (!self || !IS_BUBBLE (self)) |
376 | 2612 | return; | 2604 | return; |
377 | 2613 | 2605 | ||
379 | 2614 | priv = GET_PRIVATE (self); | 2606 | priv = self->priv; |
380 | 2615 | 2607 | ||
381 | 2616 | // only really cause a refresh (blur, recreating tile-/blur-cache) if | 2608 | // only really cause a refresh (blur, recreating tile-/blur-cache) if |
382 | 2617 | // a different value has been set, this helps improve performance when | 2609 | // a different value has been set, this helps improve performance when |
383 | @@ -2633,7 +2625,7 @@ | |||
384 | 2633 | if (!self || !IS_BUBBLE (self)) | 2625 | if (!self || !IS_BUBBLE (self)) |
385 | 2634 | return -2; | 2626 | return -2; |
386 | 2635 | 2627 | ||
388 | 2636 | return GET_PRIVATE (self)->value; | 2628 | return self->priv->value; |
389 | 2637 | } | 2629 | } |
390 | 2638 | 2630 | ||
391 | 2639 | void | 2631 | void |
392 | @@ -2644,7 +2636,7 @@ | |||
393 | 2644 | if (!self || !IS_BUBBLE (self)) | 2636 | if (!self || !IS_BUBBLE (self)) |
394 | 2645 | return; | 2637 | return; |
395 | 2646 | 2638 | ||
397 | 2647 | gtk_widget_set_size_request (GET_PRIVATE(self)->widget, width, height); | 2639 | gtk_widget_set_size_request (self->priv->widget, width, height); |
398 | 2648 | } | 2640 | } |
399 | 2649 | 2641 | ||
400 | 2650 | void | 2642 | void |
401 | @@ -2655,7 +2647,7 @@ | |||
402 | 2655 | if (!self || !IS_BUBBLE (self)) | 2647 | if (!self || !IS_BUBBLE (self)) |
403 | 2656 | return; | 2648 | return; |
404 | 2657 | 2649 | ||
406 | 2658 | gtk_widget_get_size_request (GET_PRIVATE(self)->widget, width, height); | 2650 | gtk_widget_get_size_request (self->priv->widget, width, height); |
407 | 2659 | } | 2651 | } |
408 | 2660 | 2652 | ||
409 | 2661 | void | 2653 | void |
410 | @@ -2665,7 +2657,7 @@ | |||
411 | 2665 | if (!self || !IS_BUBBLE (self)) | 2657 | if (!self || !IS_BUBBLE (self)) |
412 | 2666 | return; | 2658 | return; |
413 | 2667 | 2659 | ||
415 | 2668 | GET_PRIVATE (self)->timeout = timeout; | 2660 | self->priv->timeout = timeout; |
416 | 2669 | } | 2661 | } |
417 | 2670 | 2662 | ||
418 | 2671 | /* a timeout of 0 doesn't make much sense now does it, thus 0 indicates an | 2663 | /* a timeout of 0 doesn't make much sense now does it, thus 0 indicates an |
419 | @@ -2676,7 +2668,7 @@ | |||
420 | 2676 | if (!self || !IS_BUBBLE (self)) | 2668 | if (!self || !IS_BUBBLE (self)) |
421 | 2677 | return 0; | 2669 | return 0; |
422 | 2678 | 2670 | ||
424 | 2679 | return GET_PRIVATE(self)->timeout; | 2671 | return self->priv->timeout; |
425 | 2680 | } | 2672 | } |
426 | 2681 | 2673 | ||
427 | 2682 | void | 2674 | void |
428 | @@ -2686,7 +2678,7 @@ | |||
429 | 2686 | if (!self || !IS_BUBBLE (self)) | 2678 | if (!self || !IS_BUBBLE (self)) |
430 | 2687 | return; | 2679 | return; |
431 | 2688 | 2680 | ||
433 | 2689 | GET_PRIVATE(self)->timer_id = timer_id; | 2681 | self->priv->timer_id = timer_id; |
434 | 2690 | } | 2682 | } |
435 | 2691 | 2683 | ||
436 | 2692 | /* a valid GLib timer-id is always > 0, thus 0 indicates an error */ | 2684 | /* a valid GLib timer-id is always > 0, thus 0 indicates an error */ |
437 | @@ -2696,7 +2688,7 @@ | |||
438 | 2696 | if (!self || !IS_BUBBLE (self)) | 2688 | if (!self || !IS_BUBBLE (self)) |
439 | 2697 | return 0; | 2689 | return 0; |
440 | 2698 | 2690 | ||
442 | 2699 | return GET_PRIVATE(self)->timer_id; | 2691 | return self->priv->timer_id; |
443 | 2700 | } | 2692 | } |
444 | 2701 | 2693 | ||
445 | 2702 | void | 2694 | void |
446 | @@ -2708,7 +2700,7 @@ | |||
447 | 2708 | if (!self || !IS_BUBBLE (self)) | 2700 | if (!self || !IS_BUBBLE (self)) |
448 | 2709 | return; | 2701 | return; |
449 | 2710 | 2702 | ||
451 | 2711 | priv = GET_PRIVATE (self); | 2703 | priv = self->priv; |
452 | 2712 | 2704 | ||
453 | 2713 | /* did anything change? */ | 2705 | /* did anything change? */ |
454 | 2714 | if (priv->mouse_over != flag) | 2706 | if (priv->mouse_over != flag) |
455 | @@ -2737,7 +2729,7 @@ | |||
456 | 2737 | if (!self || !IS_BUBBLE (self)) | 2729 | if (!self || !IS_BUBBLE (self)) |
457 | 2738 | return FALSE; | 2730 | return FALSE; |
458 | 2739 | 2731 | ||
460 | 2740 | priv = GET_PRIVATE (self); | 2732 | priv = self->priv; |
461 | 2741 | 2733 | ||
462 | 2742 | if (priv->prevent_fade) | 2734 | if (priv->prevent_fade) |
463 | 2743 | return FALSE; | 2735 | return FALSE; |
464 | @@ -2753,7 +2745,7 @@ | |||
465 | 2753 | if (!self || !IS_BUBBLE (self)) | 2745 | if (!self || !IS_BUBBLE (self)) |
466 | 2754 | return; | 2746 | return; |
467 | 2755 | 2747 | ||
469 | 2756 | gtk_window_move (GTK_WINDOW (GET_PRIVATE (self)->widget), x, y); | 2748 | gtk_window_move (GTK_WINDOW (self->priv->widget), x, y); |
470 | 2757 | } | 2749 | } |
471 | 2758 | 2750 | ||
472 | 2759 | static void | 2751 | static void |
473 | @@ -2764,7 +2756,7 @@ | |||
474 | 2764 | 2756 | ||
475 | 2765 | g_return_if_fail (IS_BUBBLE (bubble)); | 2757 | g_return_if_fail (IS_BUBBLE (bubble)); |
476 | 2766 | 2758 | ||
478 | 2767 | priv = GET_PRIVATE (bubble); | 2759 | priv = bubble->priv; |
479 | 2768 | 2760 | ||
480 | 2769 | /* get rid of the alpha, so that the mouse-over algorithm notices */ | 2761 | /* get rid of the alpha, so that the mouse-over algorithm notices */ |
481 | 2770 | if (priv->alpha) | 2762 | if (priv->alpha) |
482 | @@ -2799,7 +2791,7 @@ | |||
483 | 2799 | 2791 | ||
484 | 2800 | g_return_if_fail (IS_BUBBLE (self)); | 2792 | g_return_if_fail (IS_BUBBLE (self)); |
485 | 2801 | 2793 | ||
487 | 2802 | priv = GET_PRIVATE (self); | 2794 | priv = self->priv; |
488 | 2803 | 2795 | ||
489 | 2804 | timeline = egg_timeline_new_for_duration (msecs); | 2796 | timeline = egg_timeline_new_for_duration (msecs); |
490 | 2805 | egg_timeline_set_speed (timeline, FPS); | 2797 | egg_timeline_set_speed (timeline, FPS); |
491 | @@ -2836,7 +2828,7 @@ | |||
492 | 2836 | if (!self || !IS_BUBBLE (self)) | 2828 | if (!self || !IS_BUBBLE (self)) |
493 | 2837 | return; | 2829 | return; |
494 | 2838 | 2830 | ||
496 | 2839 | priv = GET_PRIVATE (self); | 2831 | priv = self->priv; |
497 | 2840 | 2832 | ||
498 | 2841 | priv->visible = TRUE; | 2833 | priv->visible = TRUE; |
499 | 2842 | gtk_widget_show_all (priv->widget); | 2834 | gtk_widget_show_all (priv->widget); |
500 | @@ -2869,7 +2861,7 @@ | |||
501 | 2869 | return; | 2861 | return; |
502 | 2870 | 2862 | ||
503 | 2871 | /* force a redraw */ | 2863 | /* force a redraw */ |
505 | 2872 | gtk_widget_queue_draw (GET_PRIVATE (self)->widget); | 2864 | gtk_widget_queue_draw (self->priv->widget); |
506 | 2873 | } | 2865 | } |
507 | 2874 | 2866 | ||
508 | 2875 | static inline gboolean | 2867 | static inline gboolean |
509 | @@ -2877,13 +2869,13 @@ | |||
510 | 2877 | { | 2869 | { |
511 | 2878 | /* no g_return_if_fail(), the caller should have already | 2870 | /* no g_return_if_fail(), the caller should have already |
512 | 2879 | checked that */ | 2871 | checked that */ |
514 | 2880 | return gtk_widget_is_composited (GET_PRIVATE (bubble)->widget); | 2872 | return gtk_widget_is_composited (bubble->priv->widget); |
515 | 2881 | } | 2873 | } |
516 | 2882 | 2874 | ||
517 | 2883 | static inline GtkWindow* | 2875 | static inline GtkWindow* |
518 | 2884 | bubble_get_window (Bubble *bubble) | 2876 | bubble_get_window (Bubble *bubble) |
519 | 2885 | { | 2877 | { |
521 | 2886 | return GTK_WINDOW (GET_PRIVATE (bubble)->widget); | 2878 | return GTK_WINDOW (bubble->priv->widget); |
522 | 2887 | } | 2879 | } |
523 | 2888 | 2880 | ||
524 | 2889 | static void | 2881 | static void |
525 | @@ -2895,15 +2887,15 @@ | |||
526 | 2895 | 2887 | ||
527 | 2896 | g_return_if_fail (IS_BUBBLE (bubble)); | 2888 | g_return_if_fail (IS_BUBBLE (bubble)); |
528 | 2897 | 2889 | ||
530 | 2898 | opacity = (float)egg_alpha_get_alpha (GET_PRIVATE (bubble)->alpha) | 2890 | opacity = (float)egg_alpha_get_alpha (bubble->priv->alpha) |
531 | 2899 | / (float)EGG_ALPHA_MAX_ALPHA | 2891 | / (float)EGG_ALPHA_MAX_ALPHA |
532 | 2900 | * WINDOW_MAX_OPACITY; | 2892 | * WINDOW_MAX_OPACITY; |
533 | 2901 | 2893 | ||
534 | 2902 | if (bubble_is_mouse_over (bubble)) | 2894 | if (bubble_is_mouse_over (bubble)) |
536 | 2903 | gtk_widget_set_opacity (GET_PRIVATE (bubble)->widget, | 2895 | gtk_widget_set_opacity (bubble->priv->widget, |
537 | 2904 | WINDOW_MIN_OPACITY); | 2896 | WINDOW_MIN_OPACITY); |
538 | 2905 | else | 2897 | else |
540 | 2906 | gtk_widget_set_opacity (GET_PRIVATE (bubble)->widget, opacity); | 2898 | gtk_widget_set_opacity (bubble->priv->widget, opacity); |
541 | 2907 | } | 2899 | } |
542 | 2908 | 2900 | ||
543 | 2909 | static void | 2901 | static void |
544 | @@ -2929,7 +2921,7 @@ | |||
545 | 2929 | 2921 | ||
546 | 2930 | g_return_if_fail (IS_BUBBLE (bubble)); | 2922 | g_return_if_fail (IS_BUBBLE (bubble)); |
547 | 2931 | 2923 | ||
549 | 2932 | priv = GET_PRIVATE (bubble); | 2924 | priv = bubble->priv; |
550 | 2933 | 2925 | ||
551 | 2934 | /* get rid of the alpha, so that the mouse-over algorithm notices */ | 2926 | /* get rid of the alpha, so that the mouse-over algorithm notices */ |
552 | 2935 | if (priv->alpha) | 2927 | if (priv->alpha) |
553 | @@ -2945,10 +2937,10 @@ | |||
554 | 2945 | } | 2937 | } |
555 | 2946 | 2938 | ||
556 | 2947 | if (bubble_is_mouse_over (bubble)) | 2939 | if (bubble_is_mouse_over (bubble)) |
558 | 2948 | gtk_widget_set_opacity (GET_PRIVATE (bubble)->widget, | 2940 | gtk_widget_set_opacity (bubble->priv->widget, |
559 | 2949 | WINDOW_MIN_OPACITY); | 2941 | WINDOW_MIN_OPACITY); |
560 | 2950 | else | 2942 | else |
562 | 2951 | gtk_widget_set_opacity (GET_PRIVATE (bubble)->widget, | 2943 | gtk_widget_set_opacity (bubble->priv->widget, |
563 | 2952 | WINDOW_MAX_OPACITY); | 2944 | WINDOW_MAX_OPACITY); |
564 | 2953 | 2945 | ||
565 | 2954 | bubble_start_timer (bubble, TRUE); | 2946 | bubble_start_timer (bubble, TRUE); |
566 | @@ -2963,7 +2955,7 @@ | |||
567 | 2963 | 2955 | ||
568 | 2964 | g_return_if_fail (IS_BUBBLE (self)); | 2956 | g_return_if_fail (IS_BUBBLE (self)); |
569 | 2965 | 2957 | ||
571 | 2966 | priv = GET_PRIVATE (self); | 2958 | priv = self->priv; |
572 | 2967 | 2959 | ||
573 | 2968 | if (!bubble_is_composited (self) | 2960 | if (!bubble_is_composited (self) |
574 | 2969 | || msecs == 0) | 2961 | || msecs == 0) |
575 | @@ -2999,7 +2991,7 @@ | |||
576 | 2999 | 2991 | ||
577 | 3000 | egg_timeline_start (timeline); | 2992 | egg_timeline_start (timeline); |
578 | 3001 | 2993 | ||
580 | 3002 | gtk_widget_set_opacity (GET_PRIVATE (self)->widget, 0.0f); | 2994 | gtk_widget_set_opacity (self->priv->widget, 0.0f); |
581 | 3003 | 2995 | ||
582 | 3004 | bubble_show (self); | 2996 | bubble_show (self); |
583 | 3005 | } | 2997 | } |
584 | @@ -3013,7 +3005,7 @@ | |||
585 | 3013 | 3005 | ||
586 | 3014 | g_return_if_fail (IS_BUBBLE (self)); | 3006 | g_return_if_fail (IS_BUBBLE (self)); |
587 | 3015 | 3007 | ||
589 | 3016 | priv = GET_PRIVATE (self); | 3008 | priv = self->priv; |
590 | 3017 | 3009 | ||
591 | 3018 | timeline = egg_timeline_new_for_duration (msecs); | 3010 | timeline = egg_timeline_new_for_duration (msecs); |
592 | 3019 | egg_timeline_set_speed (timeline, FPS); | 3011 | egg_timeline_set_speed (timeline, FPS); |
593 | @@ -3052,7 +3044,7 @@ | |||
594 | 3052 | * g_source_remove() on it later. */ | 3044 | * g_source_remove() on it later. */ |
595 | 3053 | bubble_set_timer_id (self, 0); | 3045 | bubble_set_timer_id (self, 0); |
596 | 3054 | 3046 | ||
598 | 3055 | if (GET_PRIVATE (self)->composited) | 3047 | if (self->priv->composited) |
599 | 3056 | { | 3048 | { |
600 | 3057 | bubble_fade_out (self, 300); | 3049 | bubble_fade_out (self, 300); |
601 | 3058 | return FALSE; | 3050 | return FALSE; |
602 | @@ -3077,7 +3069,7 @@ | |||
603 | 3077 | if (!self || !IS_BUBBLE (self) || !bubble_is_visible (self)) | 3069 | if (!self || !IS_BUBBLE (self) || !bubble_is_visible (self)) |
604 | 3078 | return; | 3070 | return; |
605 | 3079 | 3071 | ||
607 | 3080 | priv = GET_PRIVATE (self); | 3072 | priv = self->priv; |
608 | 3081 | 3073 | ||
609 | 3082 | priv->visible = FALSE; | 3074 | priv->visible = FALSE; |
610 | 3083 | gtk_widget_hide (priv->widget); | 3075 | gtk_widget_hide (priv->widget); |
611 | @@ -3105,7 +3097,7 @@ | |||
612 | 3105 | if (!self || !IS_BUBBLE (self)) | 3097 | if (!self || !IS_BUBBLE (self)) |
613 | 3106 | return; | 3098 | return; |
614 | 3107 | 3099 | ||
616 | 3108 | GET_PRIVATE (self)->id = id; | 3100 | self->priv->id = id; |
617 | 3109 | } | 3101 | } |
618 | 3110 | 3102 | ||
619 | 3111 | guint | 3103 | guint |
620 | @@ -3114,7 +3106,7 @@ | |||
621 | 3114 | if (!self || !IS_BUBBLE (self)) | 3106 | if (!self || !IS_BUBBLE (self)) |
622 | 3115 | return 0; | 3107 | return 0; |
623 | 3116 | 3108 | ||
625 | 3117 | return GET_PRIVATE (self)->id; | 3109 | return self->priv->id; |
626 | 3118 | } | 3110 | } |
627 | 3119 | 3111 | ||
628 | 3120 | gboolean | 3112 | gboolean |
629 | @@ -3123,7 +3115,7 @@ | |||
630 | 3123 | if (!self || !IS_BUBBLE (self)) | 3115 | if (!self || !IS_BUBBLE (self)) |
631 | 3124 | return FALSE; | 3116 | return FALSE; |
632 | 3125 | 3117 | ||
634 | 3126 | return GET_PRIVATE (self)->visible; | 3118 | return self->priv->visible; |
635 | 3127 | } | 3119 | } |
636 | 3128 | 3120 | ||
637 | 3129 | void | 3121 | void |
638 | @@ -3136,7 +3128,7 @@ | |||
639 | 3136 | if (!self || !IS_BUBBLE (self)) | 3128 | if (!self || !IS_BUBBLE (self)) |
640 | 3137 | return; | 3129 | return; |
641 | 3138 | 3130 | ||
643 | 3139 | priv = GET_PRIVATE (self); | 3131 | priv = self->priv; |
644 | 3140 | 3132 | ||
645 | 3141 | timer_id = bubble_get_timer_id (self); | 3133 | timer_id = bubble_get_timer_id (self); |
646 | 3142 | if (timer_id > 0) | 3134 | if (timer_id > 0) |
647 | @@ -3167,7 +3159,7 @@ | |||
648 | 3167 | if (!self || !IS_BUBBLE (self)) | 3159 | if (!self || !IS_BUBBLE (self)) |
649 | 3168 | return; | 3160 | return; |
650 | 3169 | 3161 | ||
652 | 3170 | timer_id = GET_PRIVATE(self)->timer_id; | 3162 | timer_id = self->priv->timer_id; |
653 | 3171 | 3163 | ||
654 | 3172 | if (timer_id > 0) { | 3164 | if (timer_id > 0) { |
655 | 3173 | g_source_remove (timer_id); | 3165 | g_source_remove (timer_id); |
656 | @@ -3183,7 +3175,7 @@ | |||
657 | 3183 | if (!self || !IS_BUBBLE (self)) | 3175 | if (!self || !IS_BUBBLE (self)) |
658 | 3184 | return; | 3176 | return; |
659 | 3185 | 3177 | ||
661 | 3186 | gtk_window_get_position (GTK_WINDOW (GET_PRIVATE (self)->widget), | 3178 | gtk_window_get_position (GTK_WINDOW (self->priv->widget), |
662 | 3187 | x, y); | 3179 | x, y); |
663 | 3188 | } | 3180 | } |
664 | 3189 | 3181 | ||
665 | @@ -3196,7 +3188,7 @@ | |||
666 | 3196 | if (!self || !IS_BUBBLE (self)) | 3188 | if (!self || !IS_BUBBLE (self)) |
667 | 3197 | return 0; | 3189 | return 0; |
668 | 3198 | 3190 | ||
670 | 3199 | gtk_window_get_size (GTK_WINDOW (GET_PRIVATE (self)->widget), | 3191 | gtk_window_get_size (GTK_WINDOW (self->priv->widget), |
671 | 3200 | &width, | 3192 | &width, |
672 | 3201 | &height); | 3193 | &height); |
673 | 3202 | 3194 | ||
674 | @@ -3209,7 +3201,7 @@ | |||
675 | 3209 | if (!self || !IS_BUBBLE (self)) | 3201 | if (!self || !IS_BUBBLE (self)) |
676 | 3210 | return 0; | 3202 | return 0; |
677 | 3211 | 3203 | ||
679 | 3212 | return GET_PRIVATE (self)->future_height; | 3204 | return self->priv->future_height; |
680 | 3213 | } | 3205 | } |
681 | 3214 | 3206 | ||
682 | 3215 | gint | 3207 | gint |
683 | @@ -3230,7 +3222,7 @@ | |||
684 | 3230 | return 0; | 3222 | return 0; |
685 | 3231 | 3223 | ||
686 | 3232 | d = self->defaults; | 3224 | d = self->defaults; |
688 | 3233 | priv = GET_PRIVATE (self); | 3225 | priv = self->priv; |
689 | 3234 | 3226 | ||
690 | 3235 | surface = cairo_image_surface_create (CAIRO_FORMAT_A1, 1, 1); | 3227 | surface = cairo_image_surface_create (CAIRO_FORMAT_A1, 1, 1); |
691 | 3236 | if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) { | 3228 | if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) { |
692 | @@ -3306,7 +3298,7 @@ | |||
693 | 3306 | return 0; | 3298 | return 0; |
694 | 3307 | 3299 | ||
695 | 3308 | d = self->defaults; | 3300 | d = self->defaults; |
697 | 3309 | priv = GET_PRIVATE (self); | 3301 | priv = self->priv; |
698 | 3310 | 3302 | ||
699 | 3311 | cr = gdk_cairo_create (gtk_widget_get_window (priv->widget)); | 3303 | cr = gdk_cairo_create (gtk_widget_get_window (priv->widget)); |
700 | 3312 | if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) { | 3304 | if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) { |
701 | @@ -3413,7 +3405,7 @@ | |||
702 | 3413 | return; | 3405 | return; |
703 | 3414 | 3406 | ||
704 | 3415 | d = self->defaults; | 3407 | d = self->defaults; |
706 | 3416 | priv = GET_PRIVATE (self); | 3408 | priv = self->priv; |
707 | 3417 | 3409 | ||
708 | 3418 | /* FIXME: a quick fix to rescale an icon (e.g. user changed font-size or | 3410 | /* FIXME: a quick fix to rescale an icon (e.g. user changed font-size or |
709 | 3419 | ** DPI while a bubble is displayed, thus bubble is re-rendered and the | 3411 | ** DPI while a bubble is displayed, thus bubble is re-rendered and the |
710 | @@ -3448,7 +3440,7 @@ | |||
711 | 3448 | 3440 | ||
712 | 3449 | priv->title_height = _calc_title_height ( | 3441 | priv->title_height = _calc_title_height ( |
713 | 3450 | self, | 3442 | self, |
715 | 3451 | GET_PRIVATE (self)->title_width); | 3443 | self->priv->title_width); |
716 | 3452 | 3444 | ||
717 | 3453 | new_bubble_height = | 3445 | new_bubble_height = |
718 | 3454 | EM2PIXELS (defaults_get_bubble_min_height (d), d) + | 3446 | EM2PIXELS (defaults_get_bubble_min_height (d), d) + |
719 | @@ -3467,7 +3459,7 @@ | |||
720 | 3467 | 3459 | ||
721 | 3468 | priv->title_height = _calc_title_height ( | 3460 | priv->title_height = _calc_title_height ( |
722 | 3469 | self, | 3461 | self, |
724 | 3470 | GET_PRIVATE (self)->title_width); | 3462 | self->priv->title_width); |
725 | 3471 | 3463 | ||
726 | 3472 | priv->body_width = | 3464 | priv->body_width = |
727 | 3473 | EM2PIXELS (defaults_get_bubble_width (d), d) - | 3465 | EM2PIXELS (defaults_get_bubble_width (d), d) - |
728 | @@ -3610,7 +3602,7 @@ | |||
729 | 3610 | 3602 | ||
730 | 3611 | g_return_if_fail (IS_BUBBLE (self)); | 3603 | g_return_if_fail (IS_BUBBLE (self)); |
731 | 3612 | 3604 | ||
733 | 3613 | priv = GET_PRIVATE (self); | 3605 | priv = self->priv; |
734 | 3614 | 3606 | ||
735 | 3615 | if (priv->synchronous != NULL) | 3607 | if (priv->synchronous != NULL) |
736 | 3616 | g_free (priv->synchronous); | 3608 | g_free (priv->synchronous); |
737 | @@ -3626,7 +3618,7 @@ | |||
738 | 3626 | 3618 | ||
739 | 3627 | g_return_if_fail (IS_BUBBLE (self)); | 3619 | g_return_if_fail (IS_BUBBLE (self)); |
740 | 3628 | 3620 | ||
742 | 3629 | priv = GET_PRIVATE (self); | 3621 | priv = self->priv; |
743 | 3630 | 3622 | ||
744 | 3631 | if (priv->sender != NULL) | 3623 | if (priv->sender != NULL) |
745 | 3632 | g_free (priv->sender); | 3624 | g_free (priv->sender); |
746 | @@ -3640,7 +3632,7 @@ | |||
747 | 3640 | if (!self || !IS_BUBBLE (self)) | 3632 | if (!self || !IS_BUBBLE (self)) |
748 | 3641 | return FALSE; | 3633 | return FALSE; |
749 | 3642 | 3634 | ||
751 | 3643 | return (GET_PRIVATE (self)->synchronous != NULL); | 3635 | return (self->priv->synchronous != NULL); |
752 | 3644 | } | 3636 | } |
753 | 3645 | 3637 | ||
754 | 3646 | gboolean | 3638 | gboolean |
755 | @@ -3648,7 +3640,7 @@ | |||
756 | 3648 | { | 3640 | { |
757 | 3649 | g_return_val_if_fail (IS_BUBBLE (self), FALSE); | 3641 | g_return_val_if_fail (IS_BUBBLE (self), FALSE); |
758 | 3650 | 3642 | ||
760 | 3651 | return (GET_PRIVATE (self)->urgency == 2); | 3643 | return (self->priv->urgency == 2); |
761 | 3652 | } | 3644 | } |
762 | 3653 | 3645 | ||
763 | 3654 | guint | 3646 | guint |
764 | @@ -3656,7 +3648,7 @@ | |||
765 | 3656 | { | 3648 | { |
766 | 3657 | g_return_val_if_fail (IS_BUBBLE (self), 0); | 3649 | g_return_val_if_fail (IS_BUBBLE (self), 0); |
767 | 3658 | 3650 | ||
769 | 3659 | return GET_PRIVATE (self)->urgency; | 3651 | return self->priv->urgency; |
770 | 3660 | } | 3652 | } |
771 | 3661 | 3653 | ||
772 | 3662 | void | 3654 | void |
773 | @@ -3665,7 +3657,7 @@ | |||
774 | 3665 | { | 3657 | { |
775 | 3666 | g_return_if_fail (IS_BUBBLE (self)); | 3658 | g_return_if_fail (IS_BUBBLE (self)); |
776 | 3667 | 3659 | ||
778 | 3668 | GET_PRIVATE (self)->urgency = urgency; | 3660 | self->priv->urgency = urgency; |
779 | 3669 | } | 3661 | } |
780 | 3670 | 3662 | ||
781 | 3671 | void | 3663 | void |
782 | @@ -3677,7 +3669,7 @@ | |||
783 | 3677 | if (!self || !IS_BUBBLE (self)) | 3669 | if (!self || !IS_BUBBLE (self)) |
784 | 3678 | return; | 3670 | return; |
785 | 3679 | 3671 | ||
787 | 3680 | priv = GET_PRIVATE (self); | 3672 | priv = self->priv; |
788 | 3681 | 3673 | ||
789 | 3682 | /* set a sane default */ | 3674 | /* set a sane default */ |
790 | 3683 | priv->layout = LAYOUT_NONE; | 3675 | priv->layout = LAYOUT_NONE; |
791 | @@ -3748,7 +3740,7 @@ | |||
792 | 3748 | if (!self || !IS_BUBBLE (self)) | 3740 | if (!self || !IS_BUBBLE (self)) |
793 | 3749 | return LAYOUT_NONE; | 3741 | return LAYOUT_NONE; |
794 | 3750 | 3742 | ||
796 | 3751 | return GET_PRIVATE (self)->layout; | 3743 | return self->priv->layout; |
797 | 3752 | } | 3744 | } |
798 | 3753 | 3745 | ||
799 | 3754 | void | 3746 | void |
800 | @@ -3758,7 +3750,7 @@ | |||
801 | 3758 | if (!self || !IS_BUBBLE (self)) | 3750 | if (!self || !IS_BUBBLE (self)) |
802 | 3759 | return; | 3751 | return; |
803 | 3760 | 3752 | ||
805 | 3761 | GET_PRIVATE (self)->icon_only = allowed; | 3753 | self->priv->icon_only = allowed; |
806 | 3762 | } | 3754 | } |
807 | 3763 | 3755 | ||
808 | 3764 | void | 3756 | void |
809 | @@ -3768,7 +3760,7 @@ | |||
810 | 3768 | if (!self || !IS_BUBBLE (self)) | 3760 | if (!self || !IS_BUBBLE (self)) |
811 | 3769 | return; | 3761 | return; |
812 | 3770 | 3762 | ||
814 | 3771 | GET_PRIVATE (self)->append = allowed; | 3763 | self->priv->append = allowed; |
815 | 3772 | } | 3764 | } |
816 | 3773 | 3765 | ||
817 | 3774 | 3766 | ||
818 | @@ -3778,7 +3770,7 @@ | |||
819 | 3778 | if (!self || !IS_BUBBLE (self)) | 3770 | if (!self || !IS_BUBBLE (self)) |
820 | 3779 | return FALSE; | 3771 | return FALSE; |
821 | 3780 | 3772 | ||
823 | 3781 | return GET_PRIVATE (self)->append; | 3773 | return self->priv->append; |
824 | 3782 | } | 3774 | } |
825 | 3783 | 3775 | ||
826 | 3784 | void | 3776 | void |
827 | @@ -3793,7 +3785,7 @@ | |||
828 | 3793 | if (!self || !IS_BUBBLE (self) || !append_body) | 3785 | if (!self || !IS_BUBBLE (self) || !append_body) |
829 | 3794 | return; | 3786 | return; |
830 | 3795 | 3787 | ||
832 | 3796 | priv = GET_PRIVATE (self); | 3788 | priv = self->priv; |
833 | 3797 | 3789 | ||
834 | 3798 | // filter out any HTML/markup if possible | 3790 | // filter out any HTML/markup if possible |
835 | 3799 | result = pango_parse_markup (append_body, | 3791 | result = pango_parse_markup (append_body, |
Great !Thanks for the patch.