~ubuntu-branches/ubuntu/maverick/unity/maverick

« back to all changes in this revision

Viewing changes to unity-private/places/places-place-search-extra-action.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-09-17 14:02:54 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20100917140254-6cbue12klia2f07l
Tags: 0.2.40-0ubuntu1
* New upstream release:
  - Fix inactive menus accessible (LP: #604505)
  - Fix some more memory leaks (LP: #604777, #621690, #628144)
  - Fix weird behaviors of quicklist (LP: #617339)
  - Provide an "open this folder" button (LP: #633201)
  - Hidden menu causing gap (LP: #600191)
  - Cannot go fullscreen for flash videos (LP: #631381)
  - Can't access menu items from the keyboard (LP: #636728)
  - Don't register for MDRAGs since they aren't used (LP: #632613)
  - Don't run indicator on special launchers (LP: #627488)
  - Center arrows position in folded launcher tiles (LP: #633084)
  - Launcher icons first appear as white upon login (LP: #601093)
  - Removes jittering when rubber band is in use on the launcher (LP: #632991)
  - Mutter restarts on closing almost any application (LP: #634701)
  - Can't launch apps like synaptic with root privileges from launch bar
    (LP: #599298)
  - Launcher tile dragging shouldn't be masked (LP: #631443)
  - Fix Carousel-ed icons have distorted perspective (LP: #607515)
  - Use no longer sync call (LP: #620011)
* update debian/libunity0.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* places-place-search-extra-action.c generated by valac 0.9.8, the Vala compiler
 
2
 * generated from places-place-search-extra-action.vala, do not modify */
 
3
 
 
4
/*
 
5
 * Copyright (C) 2010 Canonical Ltd
 
6
 *
 
7
 * This program is free software: you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License version 3 as
 
9
 * published by the Free Software Foundation.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 *
 
19
 * Authored by
 
20
 *               Neil Jagdish Patel <neil.patel@canonical.com>
 
21
 *               Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
 
22
 *
 
23
 */
 
24
 
 
25
#include <glib.h>
 
26
#include <glib-object.h>
 
27
#include <clutk/clutk.h>
 
28
#include <unity.h>
 
29
#include <clutter/clutter.h>
 
30
#include <float.h>
 
31
#include <math.h>
 
32
#include <stdlib.h>
 
33
#include <string.h>
 
34
#include <cairo.h>
 
35
 
 
36
 
 
37
#define UNITY_PLACES_TYPE_PLACE_SEARCH_EXTRA_ACTION (unity_places_place_search_extra_action_get_type ())
 
38
#define UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PLACES_TYPE_PLACE_SEARCH_EXTRA_ACTION, UnityPlacesPlaceSearchExtraAction))
 
39
#define UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PLACES_TYPE_PLACE_SEARCH_EXTRA_ACTION, UnityPlacesPlaceSearchExtraActionClass))
 
40
#define UNITY_PLACES_IS_PLACE_SEARCH_EXTRA_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PLACES_TYPE_PLACE_SEARCH_EXTRA_ACTION))
 
41
#define UNITY_PLACES_IS_PLACE_SEARCH_EXTRA_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PLACES_TYPE_PLACE_SEARCH_EXTRA_ACTION))
 
42
#define UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PLACES_TYPE_PLACE_SEARCH_EXTRA_ACTION, UnityPlacesPlaceSearchExtraActionClass))
 
43
 
 
44
typedef struct _UnityPlacesPlaceSearchExtraAction UnityPlacesPlaceSearchExtraAction;
 
45
typedef struct _UnityPlacesPlaceSearchExtraActionClass UnityPlacesPlaceSearchExtraActionClass;
 
46
typedef struct _UnityPlacesPlaceSearchExtraActionPrivate UnityPlacesPlaceSearchExtraActionPrivate;
 
47
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
48
#define _cairo_pattern_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_pattern_destroy (var), NULL)))
 
49
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
 
50
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
 
51
 
 
52
struct _UnityPlacesPlaceSearchExtraAction {
 
53
        CtkBin parent_instance;
 
54
        UnityPlacesPlaceSearchExtraActionPrivate * priv;
 
55
        CtkImage* image;
 
56
};
 
57
 
 
58
struct _UnityPlacesPlaceSearchExtraActionClass {
 
59
        CtkBinClass parent_class;
 
60
};
 
61
 
 
62
struct _UnityPlacesPlaceSearchExtraActionPrivate {
 
63
        UnityCairoCanvas* bg;
 
64
        ClutterColor color;
 
65
        CtkEffectGlow* glow;
 
66
        float _destroy_factor;
 
67
        float _resize_factor;
 
68
        float _last_width;
 
69
        float _resize_width;
 
70
};
 
71
 
 
72
 
 
73
static gpointer unity_places_place_search_extra_action_parent_class = NULL;
 
74
 
 
75
GType unity_places_place_search_extra_action_get_type (void) G_GNUC_CONST;
 
76
#define UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_PLACES_TYPE_PLACE_SEARCH_EXTRA_ACTION, UnityPlacesPlaceSearchExtraActionPrivate))
 
77
enum  {
 
78
        UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_DUMMY_PROPERTY,
 
79
        UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_DESTROY_FACTOR,
 
80
        UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_RESIZE_FACTOR
 
81
};
 
82
#define UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_PADDING 4.0f
 
83
UnityPlacesPlaceSearchExtraAction* unity_places_place_search_extra_action_new (void);
 
84
UnityPlacesPlaceSearchExtraAction* unity_places_place_search_extra_action_construct (GType object_type);
 
85
void unity_places_place_search_extra_action_set_icon_from_gicon_string (UnityPlacesPlaceSearchExtraAction* self, const char* icon_string);
 
86
static void unity_places_place_search_extra_action_real_get_preferred_width (ClutterActor* base, float for_height, float* min_width, float* nat_width);
 
87
static gboolean unity_places_place_search_extra_action_real_enter_event (ClutterActor* base, ClutterEvent* e);
 
88
static gboolean unity_places_place_search_extra_action_real_leave_event (ClutterActor* base, ClutterEvent* e);
 
89
static gboolean unity_places_place_search_extra_action_real_button_press_event (ClutterActor* base, ClutterEvent* e);
 
90
static gboolean unity_places_place_search_extra_action_real_button_release_event (ClutterActor* base, ClutterEvent* e);
 
91
static void unity_places_place_search_extra_action_paint_bg (UnityPlacesPlaceSearchExtraAction* self, cairo_t* cr, gint width, gint height);
 
92
float unity_places_place_search_extra_action_get_destroy_factor (UnityPlacesPlaceSearchExtraAction* self);
 
93
void unity_places_place_search_extra_action_set_destroy_factor (UnityPlacesPlaceSearchExtraAction* self, float value);
 
94
float unity_places_place_search_extra_action_get_resize_factor (UnityPlacesPlaceSearchExtraAction* self);
 
95
void unity_places_place_search_extra_action_set_resize_factor (UnityPlacesPlaceSearchExtraAction* self, float value);
 
96
static void _unity_places_place_search_extra_action_paint_bg_unity_cairo_canvas_cairo_canvas_paint (cairo_t* cr, gint width, gint height, gpointer self);
 
97
static GObject * unity_places_place_search_extra_action_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
 
98
static void unity_places_place_search_extra_action_finalize (GObject* obj);
 
99
static void unity_places_place_search_extra_action_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
 
100
static void unity_places_place_search_extra_action_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
 
101
 
 
102
 
 
103
 
 
104
UnityPlacesPlaceSearchExtraAction* unity_places_place_search_extra_action_construct (GType object_type) {
 
105
        UnityPlacesPlaceSearchExtraAction * self;
 
106
        self = (UnityPlacesPlaceSearchExtraAction*) g_object_new (object_type, "reactive", TRUE, NULL);
 
107
        return self;
 
108
}
 
109
 
 
110
 
 
111
UnityPlacesPlaceSearchExtraAction* unity_places_place_search_extra_action_new (void) {
 
112
        return unity_places_place_search_extra_action_construct (UNITY_PLACES_TYPE_PLACE_SEARCH_EXTRA_ACTION);
 
113
}
 
114
 
 
115
 
 
116
void unity_places_place_search_extra_action_set_icon_from_gicon_string (UnityPlacesPlaceSearchExtraAction* self, const char* icon_string) {
 
117
        UnityPixbufCache* _tmp0_;
 
118
        g_return_if_fail (self != NULL);
 
119
        g_return_if_fail (icon_string != NULL);
 
120
        unity_pixbuf_cache_set_image_from_gicon_string (_tmp0_ = unity_pixbuf_cache_get_default (), self->image, icon_string, 22);
 
121
        _g_object_unref0 (_tmp0_);
 
122
        ctk_effect_set_invalidate_effect_cache ((CtkEffect*) self->priv->glow, TRUE);
 
123
}
 
124
 
 
125
 
 
126
static void unity_places_place_search_extra_action_real_get_preferred_width (ClutterActor* base, float for_height, float* min_width, float* nat_width) {
 
127
        UnityPlacesPlaceSearchExtraAction * self;
 
128
        float mw = 0.0F;
 
129
        float nw = 0.0F;
 
130
        CtkPadding _tmp0_ = {0};
 
131
        CtkPadding _tmp1_ = {0};
 
132
        CtkPadding _tmp2_ = {0};
 
133
        CtkPadding _tmp3_ = {0};
 
134
        gboolean _tmp4_ = FALSE;
 
135
        self = (UnityPlacesPlaceSearchExtraAction*) base;
 
136
        CLUTTER_ACTOR_CLASS (unity_places_place_search_extra_action_parent_class)->get_preferred_width ((ClutterActor*) CTK_BIN (self), for_height, &mw, &nw);
 
137
        *min_width = ((mw + (ctk_actor_get_padding ((CtkActor*) self, &_tmp0_), _tmp0_.right)) + (ctk_actor_get_padding ((CtkActor*) self, &_tmp1_), _tmp1_.left)) * self->priv->_destroy_factor;
 
138
        *nat_width = ((nw + (ctk_actor_get_padding ((CtkActor*) self, &_tmp2_), _tmp2_.right)) + (ctk_actor_get_padding ((CtkActor*) self, &_tmp3_), _tmp3_.left)) * self->priv->_destroy_factor;
 
139
        if (self->priv->_last_width == 0.0f) {
 
140
                self->priv->_last_width = *nat_width;
 
141
        }
 
142
        if (self->priv->_last_width != (*nat_width)) {
 
143
                _tmp4_ = self->priv->_resize_factor == 1.0;
 
144
        } else {
 
145
                _tmp4_ = FALSE;
 
146
        }
 
147
        if (_tmp4_) {
 
148
                self->priv->_resize_factor = 0.0f;
 
149
                clutter_actor_animate ((ClutterActor*) self, (gulong) CLUTTER_EASE_OUT_QUAD, (guint) 100, "resize_factor", 1.0f, NULL);
 
150
                self->priv->_resize_width = self->priv->_last_width;
 
151
                self->priv->_last_width = *nat_width;
 
152
        }
 
153
        if (self->priv->_resize_factor != 1.0f) {
 
154
                *min_width = self->priv->_resize_width + (((*min_width) - self->priv->_resize_width) * self->priv->_resize_factor);
 
155
                *nat_width = self->priv->_resize_width + (((*nat_width) - self->priv->_resize_width) * self->priv->_resize_factor);
 
156
        }
 
157
}
 
158
 
 
159
 
 
160
static gboolean unity_places_place_search_extra_action_real_enter_event (ClutterActor* base, ClutterEvent* e) {
 
161
        UnityPlacesPlaceSearchExtraAction * self;
 
162
        gboolean result = FALSE;
 
163
        self = (UnityPlacesPlaceSearchExtraAction*) base;
 
164
        ctk_actor_set_state ((CtkActor*) self, CTK_STATE_PRELIGHT);
 
165
        unity_cairo_canvas_update (self->priv->bg);
 
166
        result = TRUE;
 
167
        return result;
 
168
}
 
169
 
 
170
 
 
171
static gboolean unity_places_place_search_extra_action_real_leave_event (ClutterActor* base, ClutterEvent* e) {
 
172
        UnityPlacesPlaceSearchExtraAction * self;
 
173
        gboolean result = FALSE;
 
174
        self = (UnityPlacesPlaceSearchExtraAction*) base;
 
175
        ctk_actor_set_state ((CtkActor*) self, CTK_STATE_NORMAL);
 
176
        unity_cairo_canvas_update (self->priv->bg);
 
177
        result = TRUE;
 
178
        return result;
 
179
}
 
180
 
 
181
 
 
182
static gboolean unity_places_place_search_extra_action_real_button_press_event (ClutterActor* base, ClutterEvent* e) {
 
183
        UnityPlacesPlaceSearchExtraAction * self;
 
184
        gboolean result = FALSE;
 
185
        self = (UnityPlacesPlaceSearchExtraAction*) base;
 
186
        ctk_actor_set_state ((CtkActor*) self, CTK_STATE_SELECTED);
 
187
        unity_cairo_canvas_update (self->priv->bg);
 
188
        result = FALSE;
 
189
        return result;
 
190
}
 
191
 
 
192
 
 
193
static gboolean unity_places_place_search_extra_action_real_button_release_event (ClutterActor* base, ClutterEvent* e) {
 
194
        UnityPlacesPlaceSearchExtraAction * self;
 
195
        gboolean result = FALSE;
 
196
        self = (UnityPlacesPlaceSearchExtraAction*) base;
 
197
        ctk_actor_set_state ((CtkActor*) self, CTK_STATE_PRELIGHT);
 
198
        unity_cairo_canvas_update (self->priv->bg);
 
199
        g_signal_emit_by_name (self, "activated");
 
200
        result = FALSE;
 
201
        return result;
 
202
}
 
203
 
 
204
 
 
205
static void unity_places_place_search_extra_action_paint_bg (UnityPlacesPlaceSearchExtraAction* self, cairo_t* cr, gint width, gint height) {
 
206
        gint x;
 
207
        gint y;
 
208
        gint radius;
 
209
        double _tmp0_ = 0.0;
 
210
        g_return_if_fail (self != NULL);
 
211
        g_return_if_fail (cr != NULL);
 
212
        cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
 
213
        cairo_paint (cr);
 
214
        cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 
215
        cairo_set_line_width (cr, 1.5);
 
216
        cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
 
217
        cairo_translate (cr, 0.5, 0.5);
 
218
        x = 0;
 
219
        y = 0;
 
220
        width = width - 1;
 
221
        height = height - 1;
 
222
        radius = 10;
 
223
        cairo_move_to (cr, (double) x, (double) (y + radius));
 
224
        cairo_curve_to (cr, (double) x, (double) y, (double) x, (double) y, (double) (x + radius), (double) y);
 
225
        cairo_line_to (cr, (double) (width - radius), (double) y);
 
226
        cairo_curve_to (cr, (double) width, (double) y, (double) width, (double) y, (double) width, (double) (y + radius));
 
227
        cairo_line_to (cr, (double) width, (double) (height - radius));
 
228
        cairo_curve_to (cr, (double) width, (double) height, (double) width, (double) height, (double) (width - radius), (double) height);
 
229
        cairo_line_to (cr, (double) (x + radius), (double) height);
 
230
        cairo_curve_to (cr, (double) x, (double) height, (double) x, (double) height, (double) x, (double) (height - radius));
 
231
        cairo_close_path (cr);
 
232
        if (ctk_actor_get_state ((CtkActor*) self) == CTK_STATE_SELECTED) {
 
233
                cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
 
234
        } else {
 
235
                if (ctk_actor_get_state ((CtkActor*) self) == CTK_STATE_PRELIGHT) {
 
236
                        cairo_surface_t* pattern;
 
237
                        cairo_t* context;
 
238
                        cairo_pattern_t* pat;
 
239
                        pattern = cairo_surface_create_similar (cairo_get_target (cr), CAIRO_CONTENT_COLOR_ALPHA, 4, 4);
 
240
                        context = cairo_create (pattern);
 
241
                        cairo_set_operator (context, CAIRO_OPERATOR_CLEAR);
 
242
                        cairo_paint (context);
 
243
                        cairo_set_line_width (context, 0.2);
 
244
                        cairo_set_operator (context, CAIRO_OPERATOR_OVER);
 
245
                        cairo_set_source_rgba (context, 1.0, 1.0, 1.0, 0.85);
 
246
                        cairo_move_to (context, (double) 0, (double) 0);
 
247
                        cairo_line_to (context, (double) 4, (double) 4);
 
248
                        cairo_stroke (context);
 
249
                        pat = cairo_pattern_create_for_surface (pattern);
 
250
                        cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT);
 
251
                        cairo_set_source (cr, pat);
 
252
                        _cairo_pattern_destroy0 (pat);
 
253
                        _cairo_destroy0 (context);
 
254
                        _cairo_surface_destroy0 (pattern);
 
255
                } else {
 
256
                        cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
 
257
                }
 
258
        }
 
259
        cairo_fill_preserve (cr);
 
260
        if (ctk_actor_get_state ((CtkActor*) self) == CTK_STATE_NORMAL) {
 
261
                _tmp0_ = 0.0;
 
262
        } else {
 
263
                _tmp0_ = 0.5;
 
264
        }
 
265
        cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, _tmp0_);
 
266
        cairo_stroke (cr);
 
267
}
 
268
 
 
269
 
 
270
float unity_places_place_search_extra_action_get_destroy_factor (UnityPlacesPlaceSearchExtraAction* self) {
 
271
        float result;
 
272
        g_return_val_if_fail (self != NULL, 0.0F);
 
273
        result = self->priv->_destroy_factor;
 
274
        return result;
 
275
}
 
276
 
 
277
 
 
278
void unity_places_place_search_extra_action_set_destroy_factor (UnityPlacesPlaceSearchExtraAction* self, float value) {
 
279
        g_return_if_fail (self != NULL);
 
280
        self->priv->_destroy_factor = value;
 
281
        clutter_actor_queue_relayout ((ClutterActor*) self);
 
282
        g_object_notify ((GObject *) self, "destroy-factor");
 
283
}
 
284
 
 
285
 
 
286
float unity_places_place_search_extra_action_get_resize_factor (UnityPlacesPlaceSearchExtraAction* self) {
 
287
        float result;
 
288
        g_return_val_if_fail (self != NULL, 0.0F);
 
289
        result = self->priv->_resize_factor;
 
290
        return result;
 
291
}
 
292
 
 
293
 
 
294
void unity_places_place_search_extra_action_set_resize_factor (UnityPlacesPlaceSearchExtraAction* self, float value) {
 
295
        g_return_if_fail (self != NULL);
 
296
        self->priv->_resize_factor = value;
 
297
        clutter_actor_queue_relayout ((ClutterActor*) self);
 
298
        g_object_notify ((GObject *) self, "resize-factor");
 
299
}
 
300
 
 
301
 
 
302
static void _unity_places_place_search_extra_action_paint_bg_unity_cairo_canvas_cairo_canvas_paint (cairo_t* cr, gint width, gint height, gpointer self) {
 
303
        unity_places_place_search_extra_action_paint_bg (self, cr, width, height);
 
304
}
 
305
 
 
306
 
 
307
static GObject * unity_places_place_search_extra_action_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
 
308
        GObject * obj;
 
309
        GObjectClass * parent_class;
 
310
        UnityPlacesPlaceSearchExtraAction * self;
 
311
        parent_class = G_OBJECT_CLASS (unity_places_place_search_extra_action_parent_class);
 
312
        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
 
313
        self = UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION (obj);
 
314
        {
 
315
                CtkPadding _tmp0_ = {0};
 
316
                CtkPadding _tmp1_;
 
317
                UnityCairoCanvas* _tmp2_;
 
318
                CtkEffectGlow* _tmp3_;
 
319
                ClutterColor _tmp4_ = {0};
 
320
                ClutterColor _tmp5_;
 
321
                CtkImage* _tmp6_;
 
322
                self->priv->color.alpha = (guint8) 255;
 
323
                ctk_actor_set_padding ((CtkActor*) self, (_tmp1_ = (_tmp0_.top = UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_PADDING, _tmp0_.right = UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_PADDING, _tmp0_.bottom = UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_PADDING, _tmp0_.left = UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_PADDING, _tmp0_), &_tmp1_));
 
324
                self->priv->bg = (_tmp2_ = g_object_ref_sink (unity_cairo_canvas_new (_unity_places_place_search_extra_action_paint_bg_unity_cairo_canvas_cairo_canvas_paint, self)), _g_object_unref0 (self->priv->bg), _tmp2_);
 
325
                ctk_actor_set_background ((CtkActor*) self, (ClutterActor*) self->priv->bg);
 
326
                clutter_actor_show ((ClutterActor*) self->priv->bg);
 
327
                self->priv->glow = (_tmp3_ = g_object_ref_sink ((CtkEffectGlow*) ctk_effect_glow_new ()), _g_object_unref0 (self->priv->glow), _tmp3_);
 
328
                ctk_effect_glow_set_color (self->priv->glow, (_tmp5_ = (_tmp4_.red = (guint8) 255, _tmp4_.green = (guint8) 255, _tmp4_.blue = (guint8) 255, _tmp4_.alpha = (guint8) 255, _tmp4_), &_tmp5_));
 
329
                ctk_effect_glow_set_factor (self->priv->glow, 1.0f);
 
330
                ctk_effect_set_margin ((CtkEffect*) self->priv->glow, 5);
 
331
                self->image = (_tmp6_ = g_object_ref_sink ((CtkImage*) ctk_image_new ((guint) 22)), _g_object_unref0 (self->image), _tmp6_);
 
332
                clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->image);
 
333
                clutter_actor_show ((ClutterActor*) self->image);
 
334
        }
 
335
        return obj;
 
336
}
 
337
 
 
338
 
 
339
static void unity_places_place_search_extra_action_class_init (UnityPlacesPlaceSearchExtraActionClass * klass) {
 
340
        unity_places_place_search_extra_action_parent_class = g_type_class_peek_parent (klass);
 
341
        g_type_class_add_private (klass, sizeof (UnityPlacesPlaceSearchExtraActionPrivate));
 
342
        CLUTTER_ACTOR_CLASS (klass)->get_preferred_width = unity_places_place_search_extra_action_real_get_preferred_width;
 
343
        CLUTTER_ACTOR_CLASS (klass)->enter_event = unity_places_place_search_extra_action_real_enter_event;
 
344
        CLUTTER_ACTOR_CLASS (klass)->leave_event = unity_places_place_search_extra_action_real_leave_event;
 
345
        CLUTTER_ACTOR_CLASS (klass)->button_press_event = unity_places_place_search_extra_action_real_button_press_event;
 
346
        CLUTTER_ACTOR_CLASS (klass)->button_release_event = unity_places_place_search_extra_action_real_button_release_event;
 
347
        G_OBJECT_CLASS (klass)->get_property = unity_places_place_search_extra_action_get_property;
 
348
        G_OBJECT_CLASS (klass)->set_property = unity_places_place_search_extra_action_set_property;
 
349
        G_OBJECT_CLASS (klass)->constructor = unity_places_place_search_extra_action_constructor;
 
350
        G_OBJECT_CLASS (klass)->finalize = unity_places_place_search_extra_action_finalize;
 
351
        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_DESTROY_FACTOR, g_param_spec_float ("destroy-factor", "destroy-factor", "destroy-factor", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
 
352
        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_RESIZE_FACTOR, g_param_spec_float ("resize-factor", "resize-factor", "resize-factor", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
 
353
        g_signal_new ("activated", UNITY_PLACES_TYPE_PLACE_SEARCH_EXTRA_ACTION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
 
354
}
 
355
 
 
356
 
 
357
static void unity_places_place_search_extra_action_instance_init (UnityPlacesPlaceSearchExtraAction * self) {
 
358
        self->priv = UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_GET_PRIVATE (self);
 
359
        self->priv->_destroy_factor = 1.0f;
 
360
        self->priv->_resize_factor = 1.0f;
 
361
        self->priv->_last_width = 0.0f;
 
362
        self->priv->_resize_width = 0.0f;
 
363
}
 
364
 
 
365
 
 
366
static void unity_places_place_search_extra_action_finalize (GObject* obj) {
 
367
        UnityPlacesPlaceSearchExtraAction * self;
 
368
        self = UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION (obj);
 
369
        _g_object_unref0 (self->priv->bg);
 
370
        _g_object_unref0 (self->image);
 
371
        _g_object_unref0 (self->priv->glow);
 
372
        G_OBJECT_CLASS (unity_places_place_search_extra_action_parent_class)->finalize (obj);
 
373
}
 
374
 
 
375
 
 
376
GType unity_places_place_search_extra_action_get_type (void) {
 
377
        static volatile gsize unity_places_place_search_extra_action_type_id__volatile = 0;
 
378
        if (g_once_init_enter (&unity_places_place_search_extra_action_type_id__volatile)) {
 
379
                static const GTypeInfo g_define_type_info = { sizeof (UnityPlacesPlaceSearchExtraActionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_places_place_search_extra_action_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPlacesPlaceSearchExtraAction), 0, (GInstanceInitFunc) unity_places_place_search_extra_action_instance_init, NULL };
 
380
                GType unity_places_place_search_extra_action_type_id;
 
381
                unity_places_place_search_extra_action_type_id = g_type_register_static (CTK_TYPE_BIN, "UnityPlacesPlaceSearchExtraAction", &g_define_type_info, 0);
 
382
                g_once_init_leave (&unity_places_place_search_extra_action_type_id__volatile, unity_places_place_search_extra_action_type_id);
 
383
        }
 
384
        return unity_places_place_search_extra_action_type_id__volatile;
 
385
}
 
386
 
 
387
 
 
388
static void unity_places_place_search_extra_action_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
 
389
        UnityPlacesPlaceSearchExtraAction * self;
 
390
        self = UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION (object);
 
391
        switch (property_id) {
 
392
                case UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_DESTROY_FACTOR:
 
393
                g_value_set_float (value, unity_places_place_search_extra_action_get_destroy_factor (self));
 
394
                break;
 
395
                case UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_RESIZE_FACTOR:
 
396
                g_value_set_float (value, unity_places_place_search_extra_action_get_resize_factor (self));
 
397
                break;
 
398
                default:
 
399
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
400
                break;
 
401
        }
 
402
}
 
403
 
 
404
 
 
405
static void unity_places_place_search_extra_action_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
 
406
        UnityPlacesPlaceSearchExtraAction * self;
 
407
        self = UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION (object);
 
408
        switch (property_id) {
 
409
                case UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_DESTROY_FACTOR:
 
410
                unity_places_place_search_extra_action_set_destroy_factor (self, g_value_get_float (value));
 
411
                break;
 
412
                case UNITY_PLACES_PLACE_SEARCH_EXTRA_ACTION_RESIZE_FACTOR:
 
413
                unity_places_place_search_extra_action_set_resize_factor (self, g_value_get_float (value));
 
414
                break;
 
415
                default:
 
416
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
417
                break;
 
418
        }
 
419
}
 
420
 
 
421
 
 
422
 
 
423