~ubuntu-branches/ubuntu/raring/gnome-contacts/raring-proposed

« back to all changes in this revision

Viewing changes to src/contacts-avatar-dialog.c

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-09-18 09:56:41 UTC
  • mfrom: (1.3.5)
  • Revision ID: package-import@ubuntu.com-20120918095641-0yxjv943hl8gb686
Tags: 3.5.92-0ubuntu1
* New upstream bugfix release
* debian/control:
  - Drop build-depends on libgstreamer-plugins-base0.10-dev,
    libgstreamer0.10-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* contacts-avatar-dialog.c generated by valac 0.17.5.1-049a7, the Vala compiler
 
1
/* contacts-avatar-dialog.c generated by valac 0.17.5.2-8558, the Vala compiler
2
2
 * generated from contacts-avatar-dialog.vala, do not modify */
3
3
 
4
4
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
72
72
typedef struct _ContactsContactFrame ContactsContactFrame;
73
73
typedef struct _ContactsContactFrameClass ContactsContactFrameClass;
74
74
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
75
 
typedef struct _Block34Data Block34Data;
 
75
typedef struct _Block33Data Block33Data;
76
76
typedef struct _ContactsContactPrivate ContactsContactPrivate;
77
77
 
78
78
#define CONTACTS_TYPE_STORE (contacts_store_get_type ())
86
86
typedef struct _ContactsStoreClass ContactsStoreClass;
87
87
#define _g_free0(var) (var = (g_free (var), NULL))
88
88
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
89
typedef struct _Block34Data Block34Data;
89
90
typedef struct _Block35Data Block35Data;
90
 
typedef struct _Block36Data Block36Data;
91
91
 
92
92
#define CONTACTS_TYPE_APP (contacts_app_get_type ())
93
93
#define CONTACTS_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_APP, ContactsApp))
143
143
        GdkPixbuf* new_pixbuf;
144
144
};
145
145
 
146
 
struct _Block34Data {
 
146
struct _Block33Data {
147
147
        int _ref_count_;
148
148
        ContactsAvatarDialog * self;
149
149
        GdkPixbuf* avatar_pixbuf;
164
164
        GObjectClass parent_class;
165
165
};
166
166
 
 
167
struct _Block34Data {
 
168
        int _ref_count_;
 
169
        ContactsAvatarDialog * self;
 
170
        GtkFileChooserDialog* chooser;
 
171
};
 
172
 
167
173
struct _Block35Data {
168
174
        int _ref_count_;
169
175
        ContactsAvatarDialog * self;
170
 
        GtkFileChooserDialog* chooser;
171
 
};
172
 
 
173
 
struct _Block36Data {
174
 
        int _ref_count_;
175
 
        ContactsAvatarDialog * self;
176
176
        GtkToolButton* webcam_button;
177
177
        ContactsContact* contact;
178
178
};
205
205
#define CONTACTS_AVATAR_DIALOG_n_columns 6
206
206
static GdkPixbuf* contacts_avatar_dialog_scale_pixbuf_for_avatar_use (ContactsAvatarDialog* self, GdkPixbuf* pixbuf);
207
207
static ContactsContactFrame* contacts_avatar_dialog_create_frame (ContactsAvatarDialog* self, GdkPixbuf* source_pixbuf);
208
 
static Block34Data* block34_data_ref (Block34Data* _data34_);
209
 
static void block34_data_unref (void * _userdata_);
 
208
static Block33Data* block33_data_ref (Block33Data* _data33_);
 
209
static void block33_data_unref (void * _userdata_);
210
210
ContactsContactFrame* contacts_contact_frame_new (gint size, gboolean with_button);
211
211
ContactsContactFrame* contacts_contact_frame_construct (GType object_type, gint size, gboolean with_button);
212
212
void contacts_contact_frame_set_pixbuf (ContactsContactFrame* self, GdkPixbuf* a_pixbuf);
213
 
static void __lambda30_ (Block34Data* _data34_);
 
213
static void __lambda28_ (Block33Data* _data33_);
214
214
static void contacts_avatar_dialog_selected_pixbuf (ContactsAvatarDialog* self, GdkPixbuf* pixbuf);
215
 
static void ___lambda30__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self);
 
215
static void ___lambda28__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self);
216
216
static ContactsContactFrame* contacts_avatar_dialog_frame_for_persona (ContactsAvatarDialog* self, FolksPersona* persona);
217
217
static ContactsContactFrame* contacts_avatar_dialog_frame_for_filename (ContactsAvatarDialog* self, const gchar* filename);
218
218
static void contacts_avatar_dialog_update_grid (ContactsAvatarDialog* self);
221
221
void contacts_avatar_dialog_update_preview (ContactsAvatarDialog* self, GtkFileChooser* chooser);
222
222
static void contacts_avatar_dialog_set_crop_widget (ContactsAvatarDialog* self, GdkPixbuf* pixbuf);
223
223
static void contacts_avatar_dialog_select_avatar_file_cb (ContactsAvatarDialog* self);
224
 
static Block35Data* block35_data_ref (Block35Data* _data35_);
225
 
static void block35_data_unref (void * _userdata_);
 
224
static Block34Data* block34_data_ref (Block34Data* _data34_);
 
225
static void block34_data_unref (void * _userdata_);
226
226
static void _contacts_avatar_dialog_update_preview_gtk_file_chooser_update_preview (GtkFileChooser* _sender, gpointer self);
227
 
static void __lambda31_ (Block35Data* _data35_, gint response);
228
 
static void ___lambda31__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
 
227
static void __lambda29_ (Block34Data* _data34_, gint response);
 
228
static void ___lambda29__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
229
229
ContactsAvatarDialog* contacts_avatar_dialog_new (ContactsContact* contact);
230
230
ContactsAvatarDialog* contacts_avatar_dialog_construct (GType object_type, ContactsContact* contact);
231
 
static Block36Data* block36_data_ref (Block36Data* _data36_);
232
 
static void block36_data_unref (void * _userdata_);
 
231
static Block35Data* block35_data_ref (Block35Data* _data35_);
 
232
static void block35_data_unref (void * _userdata_);
233
233
GType contacts_app_get_type (void) G_GNUC_CONST;
234
234
GType contacts_window_get_type (void) G_GNUC_CONST;
235
235
void contacts_contact_keep_widget_uptodate (ContactsContact* self, GtkWidget* w, GtkCallback callback, void* callback_target);
236
 
static void __lambda32_ (Block36Data* _data36_, GtkWidget* w);
 
236
static void __lambda30_ (Block35Data* _data35_, GtkWidget* w);
237
237
void contacts_contact_frame_set_image (ContactsContactFrame* self, FolksAvatarDetails* details, ContactsContact* contact);
238
 
static void ___lambda32__gtk_callback (GtkWidget* widget, gpointer self);
 
238
static void ___lambda30__gtk_callback (GtkWidget* widget, gpointer self);
239
239
const gchar* contacts_contact_get_display_name (ContactsContact* self);
240
240
static void _contacts_avatar_dialog_select_avatar_file_cb_gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
241
 
static void __lambda33_ (Block36Data* _data36_);
242
 
static void ___lambda33__cheese_camera_device_monitor_added (CheeseCameraDeviceMonitor* _sender, CheeseCameraDevice* device, gpointer self);
243
 
static void __lambda34_ (Block36Data* _data36_);
244
 
static void ___lambda34__cheese_camera_device_monitor_removed (CheeseCameraDeviceMonitor* _sender, const gchar* uuid, gpointer self);
 
241
static void __lambda31_ (Block35Data* _data35_);
 
242
static void ___lambda31__cheese_camera_device_monitor_added (CheeseCameraDeviceMonitor* _sender, CheeseCameraDevice* device, gpointer self);
 
243
static void __lambda32_ (Block35Data* _data35_);
 
244
static void ___lambda32__cheese_camera_device_monitor_removed (CheeseCameraDeviceMonitor* _sender, const gchar* uuid, gpointer self);
 
245
static void __lambda33_ (ContactsAvatarDialog* self, GtkToolButton* button);
 
246
static void ___lambda33__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
 
247
static void __lambda34_ (ContactsAvatarDialog* self, GtkToolButton* button);
 
248
static void ___lambda34__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
245
249
static void __lambda35_ (ContactsAvatarDialog* self, GtkToolButton* button);
246
250
static void ___lambda35__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
247
251
static void __lambda36_ (ContactsAvatarDialog* self, GtkToolButton* button);
 
252
static void __lambda37_ (ContactsAvatarDialog* self, GdkPixbuf* pix);
 
253
static void ___lambda37__cheese_camera_photo_taken (CheeseCamera* _sender, GdkPixbuf* pixbuf, gpointer self);
248
254
static void ___lambda36__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
249
 
static void __lambda37_ (ContactsAvatarDialog* self, GtkToolButton* button);
250
 
static void ___lambda37__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
251
255
static void __lambda38_ (ContactsAvatarDialog* self, GtkToolButton* button);
252
 
static void __lambda39_ (ContactsAvatarDialog* self, GdkPixbuf* pix);
253
 
static void ___lambda39__cheese_camera_photo_taken (CheeseCamera* _sender, GdkPixbuf* pixbuf, gpointer self);
254
256
static void ___lambda38__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
255
 
static void __lambda40_ (ContactsAvatarDialog* self, GtkToolButton* button);
256
 
static void ___lambda40__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
257
 
static void __lambda41_ (ContactsAvatarDialog* self, gint response_id);
 
257
static void __lambda39_ (ContactsAvatarDialog* self, gint response_id);
258
258
ContactsMemoryIcon* contacts_memory_icon_new_from_pixbuf (GdkPixbuf* pixbuf, GError** error);
259
259
ContactsMemoryIcon* contacts_memory_icon_construct_from_pixbuf (GType object_type, GdkPixbuf* pixbuf, GError** error);
260
260
GType contacts_memory_icon_get_type (void) G_GNUC_CONST;
261
 
static void ___lambda41__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
 
261
static void ___lambda39__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
262
262
static void contacts_avatar_dialog_finalize (GObject* obj);
263
263
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
264
264
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
341
341
}
342
342
 
343
343
 
344
 
static Block34Data* block34_data_ref (Block34Data* _data34_) {
345
 
        g_atomic_int_inc (&_data34_->_ref_count_);
346
 
        return _data34_;
 
344
static Block33Data* block33_data_ref (Block33Data* _data33_) {
 
345
        g_atomic_int_inc (&_data33_->_ref_count_);
 
346
        return _data33_;
347
347
}
348
348
 
349
349
 
350
 
static void block34_data_unref (void * _userdata_) {
351
 
        Block34Data* _data34_;
352
 
        _data34_ = (Block34Data*) _userdata_;
353
 
        if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
 
350
static void block33_data_unref (void * _userdata_) {
 
351
        Block33Data* _data33_;
 
352
        _data33_ = (Block33Data*) _userdata_;
 
353
        if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
354
354
                ContactsAvatarDialog * self;
355
 
                self = _data34_->self;
356
 
                _g_object_unref0 (_data34_->avatar_pixbuf);
 
355
                self = _data33_->self;
 
356
                _g_object_unref0 (_data33_->avatar_pixbuf);
357
357
                _g_object_unref0 (self);
358
 
                g_slice_free (Block34Data, _data34_);
 
358
                g_slice_free (Block33Data, _data33_);
359
359
        }
360
360
}
361
361
 
362
362
 
363
 
static void __lambda30_ (Block34Data* _data34_) {
 
363
static void __lambda28_ (Block33Data* _data33_) {
364
364
        ContactsAvatarDialog * self;
365
 
        self = _data34_->self;
366
 
        contacts_avatar_dialog_selected_pixbuf (self, _data34_->avatar_pixbuf);
 
365
        self = _data33_->self;
 
366
        contacts_avatar_dialog_selected_pixbuf (self, _data33_->avatar_pixbuf);
367
367
}
368
368
 
369
369
 
370
 
static void ___lambda30__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self) {
371
 
        __lambda30_ (self);
 
370
static void ___lambda28__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self) {
 
371
        __lambda28_ (self);
372
372
}
373
373
 
374
374
 
375
375
static ContactsContactFrame* contacts_avatar_dialog_create_frame (ContactsAvatarDialog* self, GdkPixbuf* source_pixbuf) {
376
376
        ContactsContactFrame* result = NULL;
377
 
        Block34Data* _data34_;
 
377
        Block33Data* _data33_;
378
378
        ContactsContactFrame* _tmp0_;
379
379
        ContactsContactFrame* image_frame;
380
380
        GdkPixbuf* _tmp1_;
384
384
        GdkPixbuf* _tmp4_ = NULL;
385
385
        g_return_val_if_fail (self != NULL, NULL);
386
386
        g_return_val_if_fail (source_pixbuf != NULL, NULL);
387
 
        _data34_ = g_slice_new0 (Block34Data);
388
 
        _data34_->_ref_count_ = 1;
389
 
        _data34_->self = g_object_ref (self);
 
387
        _data33_ = g_slice_new0 (Block33Data);
 
388
        _data33_->_ref_count_ = 1;
 
389
        _data33_->self = g_object_ref (self);
390
390
        _tmp0_ = contacts_contact_frame_new (CONTACTS_AVATAR_DIALOG_icons_size, TRUE);
391
391
        g_object_ref_sink (_tmp0_);
392
392
        image_frame = _tmp0_;
396
396
        contacts_contact_frame_set_pixbuf (image_frame, pixbuf);
397
397
        _tmp3_ = source_pixbuf;
398
398
        _tmp4_ = contacts_avatar_dialog_scale_pixbuf_for_avatar_use (self, _tmp3_);
399
 
        _data34_->avatar_pixbuf = _tmp4_;
400
 
        g_signal_connect_data (image_frame, "clicked", (GCallback) ___lambda30__contacts_contact_frame_clicked, block34_data_ref (_data34_), (GClosureNotify) block34_data_unref, 0);
 
399
        _data33_->avatar_pixbuf = _tmp4_;
 
400
        g_signal_connect_data (image_frame, "clicked", (GCallback) ___lambda28__contacts_contact_frame_clicked, block33_data_ref (_data33_), (GClosureNotify) block33_data_unref, 0);
401
401
        result = image_frame;
402
402
        _g_object_unref0 (pixbuf);
403
 
        block34_data_unref (_data34_);
404
 
        _data34_ = NULL;
 
403
        block33_data_unref (_data33_);
 
404
        _data33_ = NULL;
405
405
        return result;
406
406
}
407
407
 
882
882
}
883
883
 
884
884
 
885
 
static Block35Data* block35_data_ref (Block35Data* _data35_) {
886
 
        g_atomic_int_inc (&_data35_->_ref_count_);
887
 
        return _data35_;
 
885
static Block34Data* block34_data_ref (Block34Data* _data34_) {
 
886
        g_atomic_int_inc (&_data34_->_ref_count_);
 
887
        return _data34_;
888
888
}
889
889
 
890
890
 
891
 
static void block35_data_unref (void * _userdata_) {
892
 
        Block35Data* _data35_;
893
 
        _data35_ = (Block35Data*) _userdata_;
894
 
        if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
 
891
static void block34_data_unref (void * _userdata_) {
 
892
        Block34Data* _data34_;
 
893
        _data34_ = (Block34Data*) _userdata_;
 
894
        if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
895
895
                ContactsAvatarDialog * self;
896
 
                self = _data35_->self;
897
 
                _g_object_unref0 (_data35_->chooser);
 
896
                self = _data34_->self;
 
897
                _g_object_unref0 (_data34_->chooser);
898
898
                _g_object_unref0 (self);
899
 
                g_slice_free (Block35Data, _data35_);
 
899
                g_slice_free (Block34Data, _data34_);
900
900
        }
901
901
}
902
902
 
906
906
}
907
907
 
908
908
 
909
 
static void __lambda31_ (Block35Data* _data35_, gint response) {
 
909
static void __lambda29_ (Block34Data* _data34_, gint response) {
910
910
        ContactsAvatarDialog * self;
911
911
        gint _tmp0_;
912
912
        GtkFileChooserDialog* _tmp22_;
913
913
        GError * _inner_error_ = NULL;
914
 
        self = _data35_->self;
 
914
        self = _data34_->self;
915
915
        _tmp0_ = response;
916
916
        if (_tmp0_ != ((gint) GTK_RESPONSE_ACCEPT)) {
917
917
                GtkFileChooserDialog* _tmp1_;
918
 
                _tmp1_ = _data35_->chooser;
 
918
                _tmp1_ = _data34_->chooser;
919
919
                gtk_widget_destroy ((GtkWidget*) _tmp1_);
920
920
                return;
921
921
        }
937
937
                GdkPixbuf* _tmp13_;
938
938
                gint _tmp14_ = 0;
939
939
                gboolean _tmp17_;
940
 
                _tmp2_ = _data35_->chooser;
 
940
                _tmp2_ = _data34_->chooser;
941
941
                _tmp3_ = gtk_file_chooser_get_uri ((GtkFileChooser*) _tmp2_);
942
942
                _tmp4_ = _tmp3_;
943
943
                _tmp5_ = g_file_new_for_uri (_tmp4_);
1010
1010
                g_clear_error (&_inner_error_);
1011
1011
                return;
1012
1012
        }
1013
 
        _tmp22_ = _data35_->chooser;
 
1013
        _tmp22_ = _data34_->chooser;
1014
1014
        gtk_widget_destroy ((GtkWidget*) _tmp22_);
1015
1015
}
1016
1016
 
1017
1017
 
1018
 
static void ___lambda31__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
1019
 
        __lambda31_ (self, response_id);
 
1018
static void ___lambda29__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
 
1019
        __lambda29_ (self, response_id);
1020
1020
}
1021
1021
 
1022
1022
 
1023
1023
static void contacts_avatar_dialog_select_avatar_file_cb (ContactsAvatarDialog* self) {
1024
 
        Block35Data* _data35_;
 
1024
        Block34Data* _data34_;
1025
1025
        const gchar* _tmp0_ = NULL;
1026
1026
        GtkWidget* _tmp1_ = NULL;
1027
1027
        GtkFileChooserDialog* _tmp2_;
1042
1042
        GtkFileChooserDialog* _tmp17_;
1043
1043
        GtkFileChooserDialog* _tmp18_;
1044
1044
        g_return_if_fail (self != NULL);
1045
 
        _data35_ = g_slice_new0 (Block35Data);
1046
 
        _data35_->_ref_count_ = 1;
1047
 
        _data35_->self = g_object_ref (self);
 
1045
        _data34_ = g_slice_new0 (Block34Data);
 
1046
        _data34_->_ref_count_ = 1;
 
1047
        _data34_->self = g_object_ref (self);
1048
1048
        _tmp0_ = _ ("Browse for more pictures");
1049
1049
        _tmp1_ = gtk_widget_get_toplevel ((GtkWidget*) self);
1050
1050
        _tmp2_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GTK_TYPE_WINDOW, GtkWindow), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
1051
1051
        g_object_ref_sink (_tmp2_);
1052
 
        _data35_->chooser = _tmp2_;
1053
 
        _tmp3_ = _data35_->chooser;
 
1052
        _data34_->chooser = _tmp2_;
 
1053
        _tmp3_ = _data34_->chooser;
1054
1054
        gtk_window_set_modal ((GtkWindow*) _tmp3_, TRUE);
1055
 
        _tmp4_ = _data35_->chooser;
 
1055
        _tmp4_ = _data34_->chooser;
1056
1056
        gtk_file_chooser_set_local_only ((GtkFileChooser*) _tmp4_, FALSE);
1057
1057
        _tmp5_ = (GtkImage*) gtk_image_new ();
1058
1058
        g_object_ref_sink (_tmp5_);
1059
1059
        preview = _tmp5_;
1060
1060
        _tmp6_ = preview;
1061
1061
        gtk_widget_set_size_request ((GtkWidget*) _tmp6_, 128, -1);
1062
 
        _tmp7_ = _data35_->chooser;
 
1062
        _tmp7_ = _data34_->chooser;
1063
1063
        _tmp8_ = preview;
1064
1064
        gtk_file_chooser_set_preview_widget ((GtkFileChooser*) _tmp7_, (GtkWidget*) _tmp8_);
1065
 
        _tmp9_ = _data35_->chooser;
 
1065
        _tmp9_ = _data34_->chooser;
1066
1066
        gtk_file_chooser_set_use_preview_label ((GtkFileChooser*) _tmp9_, FALSE);
1067
1067
        _tmp10_ = preview;
1068
1068
        gtk_widget_show ((GtkWidget*) _tmp10_);
1069
 
        _tmp11_ = _data35_->chooser;
 
1069
        _tmp11_ = _data34_->chooser;
1070
1070
        g_signal_connect_object ((GtkFileChooser*) _tmp11_, "update-preview", (GCallback) _contacts_avatar_dialog_update_preview_gtk_file_chooser_update_preview, self, 0);
1071
1071
        _tmp12_ = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
1072
1072
        _tmp13_ = g_strdup (_tmp12_);
1075
1075
        if (_tmp14_ != NULL) {
1076
1076
                GtkFileChooserDialog* _tmp15_;
1077
1077
                const gchar* _tmp16_;
1078
 
                _tmp15_ = _data35_->chooser;
 
1078
                _tmp15_ = _data34_->chooser;
1079
1079
                _tmp16_ = folder;
1080
1080
                gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp15_, _tmp16_);
1081
1081
        }
1082
 
        _tmp17_ = _data35_->chooser;
1083
 
        g_signal_connect_data ((GtkDialog*) _tmp17_, "response", (GCallback) ___lambda31__gtk_dialog_response, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
1084
 
        _tmp18_ = _data35_->chooser;
 
1082
        _tmp17_ = _data34_->chooser;
 
1083
        g_signal_connect_data ((GtkDialog*) _tmp17_, "response", (GCallback) ___lambda29__gtk_dialog_response, block34_data_ref (_data34_), (GClosureNotify) block34_data_unref, 0);
 
1084
        _tmp18_ = _data34_->chooser;
1085
1085
        gtk_window_present ((GtkWindow*) _tmp18_);
1086
1086
        _g_free0 (folder);
1087
1087
        _g_object_unref0 (preview);
1088
 
        block35_data_unref (_data35_);
1089
 
        _data35_ = NULL;
1090
 
}
1091
 
 
1092
 
 
1093
 
static Block36Data* block36_data_ref (Block36Data* _data36_) {
1094
 
        g_atomic_int_inc (&_data36_->_ref_count_);
1095
 
        return _data36_;
1096
 
}
1097
 
 
1098
 
 
1099
 
static void block36_data_unref (void * _userdata_) {
1100
 
        Block36Data* _data36_;
1101
 
        _data36_ = (Block36Data*) _userdata_;
1102
 
        if (g_atomic_int_dec_and_test (&_data36_->_ref_count_)) {
 
1088
        block34_data_unref (_data34_);
 
1089
        _data34_ = NULL;
 
1090
}
 
1091
 
 
1092
 
 
1093
static Block35Data* block35_data_ref (Block35Data* _data35_) {
 
1094
        g_atomic_int_inc (&_data35_->_ref_count_);
 
1095
        return _data35_;
 
1096
}
 
1097
 
 
1098
 
 
1099
static void block35_data_unref (void * _userdata_) {
 
1100
        Block35Data* _data35_;
 
1101
        _data35_ = (Block35Data*) _userdata_;
 
1102
        if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
1103
1103
                ContactsAvatarDialog * self;
1104
 
                self = _data36_->self;
1105
 
                _g_object_unref0 (_data36_->webcam_button);
1106
 
                _g_object_unref0 (_data36_->contact);
 
1104
                self = _data35_->self;
 
1105
                _g_object_unref0 (_data35_->webcam_button);
 
1106
                _g_object_unref0 (_data35_->contact);
1107
1107
                _g_object_unref0 (self);
1108
 
                g_slice_free (Block36Data, _data36_);
 
1108
                g_slice_free (Block35Data, _data35_);
1109
1109
        }
1110
1110
}
1111
1111
 
1112
1112
 
1113
 
static void __lambda32_ (Block36Data* _data36_, GtkWidget* w) {
 
1113
static void __lambda30_ (Block35Data* _data35_, GtkWidget* w) {
1114
1114
        ContactsAvatarDialog * self;
1115
1115
        GtkWidget* _tmp0_;
1116
1116
        ContactsContact* _tmp1_;
1117
1117
        FolksIndividual* _tmp2_;
1118
1118
        ContactsContact* _tmp3_;
1119
 
        self = _data36_->self;
 
1119
        self = _data35_->self;
1120
1120
        g_return_if_fail (w != NULL);
1121
1121
        _tmp0_ = w;
1122
 
        _tmp1_ = _data36_->contact;
 
1122
        _tmp1_ = _data35_->contact;
1123
1123
        _tmp2_ = _tmp1_->individual;
1124
 
        _tmp3_ = _data36_->contact;
 
1124
        _tmp3_ = _data35_->contact;
1125
1125
        contacts_contact_frame_set_image (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, CONTACTS_TYPE_CONTACT_FRAME) ? ((ContactsContactFrame*) _tmp0_) : NULL, (FolksAvatarDetails*) _tmp2_, _tmp3_);
1126
1126
}
1127
1127
 
1128
1128
 
1129
 
static void ___lambda32__gtk_callback (GtkWidget* widget, gpointer self) {
1130
 
        __lambda32_ (self, widget);
 
1129
static void ___lambda30__gtk_callback (GtkWidget* widget, gpointer self) {
 
1130
        __lambda30_ (self, widget);
1131
1131
}
1132
1132
 
1133
1133
 
1136
1136
}
1137
1137
 
1138
1138
 
1139
 
static void __lambda33_ (Block36Data* _data36_) {
 
1139
static void __lambda31_ (Block35Data* _data35_) {
1140
1140
        ContactsAvatarDialog * self;
1141
1141
        gint _tmp0_;
1142
1142
        gint _tmp1_;
1143
 
        self = _data36_->self;
 
1143
        self = _data35_->self;
1144
1144
        _tmp0_ = self->priv->num_cameras;
1145
1145
        self->priv->num_cameras = _tmp0_ + 1;
1146
1146
        _tmp1_ = self->priv->num_cameras;
1147
 
        gtk_widget_set_sensitive ((GtkWidget*) _data36_->webcam_button, _tmp1_ > 0);
1148
 
}
1149
 
 
1150
 
 
1151
 
static void ___lambda33__cheese_camera_device_monitor_added (CheeseCameraDeviceMonitor* _sender, CheeseCameraDevice* device, gpointer self) {
1152
 
        __lambda33_ (self);
1153
 
}
1154
 
 
1155
 
 
1156
 
static void __lambda34_ (Block36Data* _data36_) {
 
1147
        gtk_widget_set_sensitive ((GtkWidget*) _data35_->webcam_button, _tmp1_ > 0);
 
1148
}
 
1149
 
 
1150
 
 
1151
static void ___lambda31__cheese_camera_device_monitor_added (CheeseCameraDeviceMonitor* _sender, CheeseCameraDevice* device, gpointer self) {
 
1152
        __lambda31_ (self);
 
1153
}
 
1154
 
 
1155
 
 
1156
static void __lambda32_ (Block35Data* _data35_) {
1157
1157
        ContactsAvatarDialog * self;
1158
1158
        gint _tmp0_;
1159
1159
        gint _tmp1_;
1160
 
        self = _data36_->self;
 
1160
        self = _data35_->self;
1161
1161
        _tmp0_ = self->priv->num_cameras;
1162
1162
        self->priv->num_cameras = _tmp0_ - 1;
1163
1163
        _tmp1_ = self->priv->num_cameras;
1164
 
        gtk_widget_set_sensitive ((GtkWidget*) _data36_->webcam_button, _tmp1_ > 0);
1165
 
}
1166
 
 
1167
 
 
1168
 
static void ___lambda34__cheese_camera_device_monitor_removed (CheeseCameraDeviceMonitor* _sender, const gchar* uuid, gpointer self) {
1169
 
        __lambda34_ (self);
1170
 
}
1171
 
 
1172
 
 
1173
 
static void __lambda35_ (ContactsAvatarDialog* self, GtkToolButton* button) {
 
1164
        gtk_widget_set_sensitive ((GtkWidget*) _data35_->webcam_button, _tmp1_ > 0);
 
1165
}
 
1166
 
 
1167
 
 
1168
static void ___lambda32__cheese_camera_device_monitor_removed (CheeseCameraDeviceMonitor* _sender, const gchar* uuid, gpointer self) {
 
1169
        __lambda32_ (self);
 
1170
}
 
1171
 
 
1172
 
 
1173
static void __lambda33_ (ContactsAvatarDialog* self, GtkToolButton* button) {
1174
1174
        GtkNotebook* _tmp0_;
1175
1175
        CheeseWidget* _tmp1_;
1176
1176
        g_return_if_fail (button != NULL);
1181
1181
}
1182
1182
 
1183
1183
 
1184
 
static void ___lambda35__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1185
 
        __lambda35_ (self, _sender);
 
1184
static void ___lambda33__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
 
1185
        __lambda33_ (self, _sender);
1186
1186
}
1187
1187
 
1188
1188
 
1189
 
static void __lambda36_ (ContactsAvatarDialog* self, GtkToolButton* button) {
 
1189
static void __lambda34_ (ContactsAvatarDialog* self, GtkToolButton* button) {
1190
1190
        UmCropArea* _tmp0_;
1191
1191
        GdkPixbuf* _tmp1_ = NULL;
1192
1192
        GdkPixbuf* pix;
1210
1210
}
1211
1211
 
1212
1212
 
1213
 
static void ___lambda36__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1214
 
        __lambda36_ (self, _sender);
 
1213
static void ___lambda34__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
 
1214
        __lambda34_ (self, _sender);
1215
1215
}
1216
1216
 
1217
1217
 
1218
 
static void __lambda37_ (ContactsAvatarDialog* self, GtkToolButton* button) {
 
1218
static void __lambda35_ (ContactsAvatarDialog* self, GtkToolButton* button) {
1219
1219
        UmCropArea* _tmp0_;
1220
1220
        GtkNotebook* _tmp1_;
1221
1221
        g_return_if_fail (button != NULL);
1226
1226
}
1227
1227
 
1228
1228
 
1229
 
static void ___lambda37__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1230
 
        __lambda37_ (self, _sender);
 
1229
static void ___lambda35__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
 
1230
        __lambda35_ (self, _sender);
1231
1231
}
1232
1232
 
1233
1233
 
1234
 
static void __lambda39_ (ContactsAvatarDialog* self, GdkPixbuf* pix) {
 
1234
static void __lambda37_ (ContactsAvatarDialog* self, GdkPixbuf* pix) {
1235
1235
        GdkPixbuf* _tmp0_;
1236
1236
        CheeseWidget* _tmp1_;
1237
1237
        g_return_if_fail (pix != NULL);
1242
1242
}
1243
1243
 
1244
1244
 
1245
 
static void ___lambda39__cheese_camera_photo_taken (CheeseCamera* _sender, GdkPixbuf* pixbuf, gpointer self) {
1246
 
        __lambda39_ (self, pixbuf);
 
1245
static void ___lambda37__cheese_camera_photo_taken (CheeseCamera* _sender, GdkPixbuf* pixbuf, gpointer self) {
 
1246
        __lambda37_ (self, pixbuf);
1247
1247
}
1248
1248
 
1249
1249
 
1250
 
static void __lambda38_ (ContactsAvatarDialog* self, GtkToolButton* button) {
 
1250
static void __lambda36_ (ContactsAvatarDialog* self, GtkToolButton* button) {
1251
1251
        CheeseWidget* _tmp0_;
1252
1252
        GObject* _tmp1_ = NULL;
1253
1253
        CheeseCamera* _tmp2_;
1289
1289
        _tmp12_ = rect;
1290
1290
        cheese_flash_fire (_tmp11_, &_tmp12_);
1291
1291
        _tmp13_ = camera;
1292
 
        g_signal_connect_object (_tmp13_, "photo-taken", (GCallback) ___lambda39__cheese_camera_photo_taken, self, 0);
 
1292
        g_signal_connect_object (_tmp13_, "photo-taken", (GCallback) ___lambda37__cheese_camera_photo_taken, self, 0);
1293
1293
        _tmp14_ = camera;
1294
1294
        _tmp15_ = cheese_camera_take_photo_pixbuf (_tmp14_);
1295
1295
        if (!_tmp15_) {
1300
1300
}
1301
1301
 
1302
1302
 
 
1303
static void ___lambda36__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
 
1304
        __lambda36_ (self, _sender);
 
1305
}
 
1306
 
 
1307
 
 
1308
static void __lambda38_ (ContactsAvatarDialog* self, GtkToolButton* button) {
 
1309
        GtkNotebook* _tmp0_;
 
1310
        CheeseWidget* _tmp1_;
 
1311
        g_return_if_fail (button != NULL);
 
1312
        _tmp0_ = self->priv->notebook;
 
1313
        gtk_notebook_set_current_page (_tmp0_, 0);
 
1314
        _tmp1_ = self->priv->cheese;
 
1315
        gtk_widget_hide ((GtkWidget*) _tmp1_);
 
1316
}
 
1317
 
 
1318
 
1303
1319
static void ___lambda38__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1304
1320
        __lambda38_ (self, _sender);
1305
1321
}
1306
1322
 
1307
1323
 
1308
 
static void __lambda40_ (ContactsAvatarDialog* self, GtkToolButton* button) {
1309
 
        GtkNotebook* _tmp0_;
1310
 
        CheeseWidget* _tmp1_;
1311
 
        g_return_if_fail (button != NULL);
1312
 
        _tmp0_ = self->priv->notebook;
1313
 
        gtk_notebook_set_current_page (_tmp0_, 0);
1314
 
        _tmp1_ = self->priv->cheese;
1315
 
        gtk_widget_hide ((GtkWidget*) _tmp1_);
1316
 
}
1317
 
 
1318
 
 
1319
 
static void ___lambda40__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
1320
 
        __lambda40_ (self, _sender);
1321
 
}
1322
 
 
1323
 
 
1324
 
static void __lambda41_ (ContactsAvatarDialog* self, gint response_id) {
 
1324
static void __lambda39_ (ContactsAvatarDialog* self, gint response_id) {
1325
1325
        gint _tmp0_;
1326
1326
        GError * _inner_error_ = NULL;
1327
1327
        _tmp0_ = response_id;
1362
1362
}
1363
1363
 
1364
1364
 
1365
 
static void ___lambda41__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
1366
 
        __lambda41_ (self, response_id);
 
1365
static void ___lambda39__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
 
1366
        __lambda39_ (self, response_id);
1367
1367
}
1368
1368
 
1369
1369
 
1370
1370
ContactsAvatarDialog* contacts_avatar_dialog_construct (GType object_type, ContactsContact* contact) {
1371
1371
        ContactsAvatarDialog * self = NULL;
1372
 
        Block36Data* _data36_;
 
1372
        Block35Data* _data35_;
1373
1373
        ContactsContact* _tmp0_;
1374
1374
        ContactsContact* _tmp1_;
1375
1375
        GnomeDesktopThumbnailFactory* _tmp2_;
1499
1499
        GtkGrid* _tmp116_;
1500
1500
        GtkNotebook* _tmp117_;
1501
1501
        g_return_val_if_fail (contact != NULL, NULL);
1502
 
        _data36_ = g_slice_new0 (Block36Data);
1503
 
        _data36_->_ref_count_ = 1;
 
1502
        _data35_ = g_slice_new0 (Block35Data);
 
1503
        _data35_->_ref_count_ = 1;
1504
1504
        _tmp0_ = contact;
1505
1505
        _tmp1_ = _g_object_ref0 (_tmp0_);
1506
 
        _data36_->contact = _tmp1_;
 
1506
        _data35_->contact = _tmp1_;
1507
1507
        self = (ContactsAvatarDialog*) g_object_new (object_type, NULL);
1508
 
        _data36_->self = g_object_ref (self);
 
1508
        _data35_->self = g_object_ref (self);
1509
1509
        _tmp2_ = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL);
1510
1510
        _g_object_unref0 (self->priv->thumbnail_factory);
1511
1511
        self->priv->thumbnail_factory = _tmp2_;
1512
 
        _tmp3_ = _data36_->contact;
 
1512
        _tmp3_ = _data35_->contact;
1513
1513
        _tmp4_ = _g_object_ref0 (_tmp3_);
1514
1514
        _g_object_unref0 (self->priv->contact);
1515
1515
        self->priv->contact = _tmp4_;
1534
1534
        g_object_ref_sink (_tmp12_);
1535
1535
        _g_object_unref0 (self->priv->main_frame);
1536
1536
        self->priv->main_frame = _tmp12_;
1537
 
        _tmp13_ = _data36_->contact;
 
1537
        _tmp13_ = _data35_->contact;
1538
1538
        _tmp14_ = self->priv->main_frame;
1539
 
        contacts_contact_keep_widget_uptodate (_tmp13_, (GtkWidget*) _tmp14_, ___lambda32__gtk_callback, _data36_);
 
1539
        contacts_contact_keep_widget_uptodate (_tmp13_, (GtkWidget*) _tmp14_, ___lambda30__gtk_callback, _data35_);
1540
1540
        _tmp15_ = self->priv->main_frame;
1541
1541
        gtk_widget_set_hexpand ((GtkWidget*) _tmp15_, FALSE);
1542
1542
        _tmp16_ = self->priv->main_frame;
1544
1544
        _tmp17_ = (GtkLabel*) gtk_label_new ("");
1545
1545
        g_object_ref_sink (_tmp17_);
1546
1546
        label = _tmp17_;
1547
 
        _tmp18_ = _data36_->contact;
 
1547
        _tmp18_ = _data35_->contact;
1548
1548
        _tmp19_ = contacts_contact_get_display_name (_tmp18_);
1549
1549
        _tmp20_ = _tmp19_;
1550
1550
        _tmp21_ = g_markup_printf_escaped ("<span font='16'>%s</span>", _tmp20_);
1618
1618
        g_signal_connect_object (the_add_button, "clicked", (GCallback) _contacts_avatar_dialog_select_avatar_file_cb_gtk_tool_button_clicked, self, 0);
1619
1619
        _tmp44_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
1620
1620
        g_object_ref_sink (_tmp44_);
1621
 
        _data36_->webcam_button = _tmp44_;
1622
 
        gtk_tool_button_set_icon_name (_data36_->webcam_button, "camera-photo-symbolic");
1623
 
        _tmp45_ = gtk_widget_get_style_context ((GtkWidget*) _data36_->webcam_button);
 
1621
        _data35_->webcam_button = _tmp44_;
 
1622
        gtk_tool_button_set_icon_name (_data35_->webcam_button, "camera-photo-symbolic");
 
1623
        _tmp45_ = gtk_widget_get_style_context ((GtkWidget*) _data35_->webcam_button);
1624
1624
        gtk_style_context_add_class (_tmp45_, GTK_STYLE_CLASS_RAISED);
1625
 
        gtk_tool_item_set_is_important ((GtkToolItem*) _data36_->webcam_button, TRUE);
1626
 
        gtk_widget_set_sensitive ((GtkWidget*) _data36_->webcam_button, FALSE);
 
1625
        gtk_tool_item_set_is_important ((GtkToolItem*) _data35_->webcam_button, TRUE);
 
1626
        gtk_widget_set_sensitive ((GtkWidget*) _data35_->webcam_button, FALSE);
1627
1627
        _tmp46_ = toolbar;
1628
 
        gtk_container_add ((GtkContainer*) _tmp46_, (GtkWidget*) _data36_->webcam_button);
 
1628
        gtk_container_add ((GtkContainer*) _tmp46_, (GtkWidget*) _data35_->webcam_button);
1629
1629
        _tmp47_ = (CheeseCameraDeviceMonitor*) cheese_camera_device_monitor_new ();
1630
1630
        _g_object_unref0 (self->priv->camera_monitor);
1631
1631
        self->priv->camera_monitor = _tmp47_;
1632
1632
        _tmp48_ = self->priv->camera_monitor;
1633
 
        g_signal_connect_data (_tmp48_, "added", (GCallback) ___lambda33__cheese_camera_device_monitor_added, block36_data_ref (_data36_), (GClosureNotify) block36_data_unref, 0);
 
1633
        g_signal_connect_data (_tmp48_, "added", (GCallback) ___lambda31__cheese_camera_device_monitor_added, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
1634
1634
        _tmp49_ = self->priv->camera_monitor;
1635
 
        g_signal_connect_data (_tmp49_, "removed", (GCallback) ___lambda34__cheese_camera_device_monitor_removed, block36_data_ref (_data36_), (GClosureNotify) block36_data_unref, 0);
 
1635
        g_signal_connect_data (_tmp49_, "removed", (GCallback) ___lambda32__cheese_camera_device_monitor_removed, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
1636
1636
        _tmp50_ = self->priv->camera_monitor;
1637
1637
        cheese_camera_device_monitor_coldplug (_tmp50_);
1638
 
        g_signal_connect_object (_data36_->webcam_button, "clicked", (GCallback) ___lambda35__gtk_tool_button_clicked, self, 0);
 
1638
        g_signal_connect_object (_data35_->webcam_button, "clicked", (GCallback) ___lambda33__gtk_tool_button_clicked, self, 0);
1639
1639
        _tmp51_ = frame_grid;
1640
1640
        gtk_widget_show_all ((GtkWidget*) _tmp51_);
1641
1641
        _tmp52_ = self->priv->notebook;
1675
1675
        _tmp69_ = accept_button;
1676
1676
        gtk_container_add ((GtkContainer*) _tmp68_, (GtkWidget*) _tmp69_);
1677
1677
        _tmp70_ = accept_button;
1678
 
        g_signal_connect_object (_tmp70_, "clicked", (GCallback) ___lambda36__gtk_tool_button_clicked, self, 0);
 
1678
        g_signal_connect_object (_tmp70_, "clicked", (GCallback) ___lambda34__gtk_tool_button_clicked, self, 0);
1679
1679
        _tmp71_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
1680
1680
        g_object_ref_sink (_tmp71_);
1681
1681
        cancel_button = _tmp71_;
1690
1690
        _tmp77_ = cancel_button;
1691
1691
        gtk_container_add ((GtkContainer*) _tmp76_, (GtkWidget*) _tmp77_);
1692
1692
        _tmp78_ = cancel_button;
1693
 
        g_signal_connect_object (_tmp78_, "clicked", (GCallback) ___lambda37__gtk_tool_button_clicked, self, 0);
 
1693
        g_signal_connect_object (_tmp78_, "clicked", (GCallback) ___lambda35__gtk_tool_button_clicked, self, 0);
1694
1694
        _tmp79_ = frame_grid;
1695
1695
        gtk_widget_show_all ((GtkWidget*) _tmp79_);
1696
1696
        _tmp80_ = self->priv->notebook;
1748
1748
        _tmp104_ = accept_button;
1749
1749
        gtk_container_add ((GtkContainer*) _tmp103_, (GtkWidget*) _tmp104_);
1750
1750
        _tmp105_ = accept_button;
1751
 
        g_signal_connect_object (_tmp105_, "clicked", (GCallback) ___lambda38__gtk_tool_button_clicked, self, 0);
 
1751
        g_signal_connect_object (_tmp105_, "clicked", (GCallback) ___lambda36__gtk_tool_button_clicked, self, 0);
1752
1752
        _tmp106_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
1753
1753
        g_object_ref_sink (_tmp106_);
1754
1754
        _g_object_unref0 (cancel_button);
1764
1764
        _tmp112_ = cancel_button;
1765
1765
        gtk_container_add ((GtkContainer*) _tmp111_, (GtkWidget*) _tmp112_);
1766
1766
        _tmp113_ = cancel_button;
1767
 
        g_signal_connect_object (_tmp113_, "clicked", (GCallback) ___lambda40__gtk_tool_button_clicked, self, 0);
 
1767
        g_signal_connect_object (_tmp113_, "clicked", (GCallback) ___lambda38__gtk_tool_button_clicked, self, 0);
1768
1768
        _tmp114_ = frame_grid;
1769
1769
        gtk_widget_show_all ((GtkWidget*) _tmp114_);
1770
1770
        _tmp115_ = self->priv->notebook;
1772
1772
        gtk_notebook_append_page (_tmp115_, (GtkWidget*) _tmp116_, NULL);
1773
1773
        _tmp117_ = self->priv->notebook;
1774
1774
        gtk_notebook_set_current_page (_tmp117_, 0);
1775
 
        g_signal_connect_object ((GtkDialog*) self, "response", (GCallback) ___lambda41__gtk_dialog_response, self, 0);
 
1775
        g_signal_connect_object ((GtkDialog*) self, "response", (GCallback) ___lambda39__gtk_dialog_response, self, 0);
1776
1776
        contacts_avatar_dialog_update_grid (self);
1777
1777
        gtk_widget_show_all ((GtkWidget*) grid);
1778
1778
        _g_object_unref0 (cancel_button);
1785
1785
        _g_object_unref0 (label);
1786
1786
        _g_object_unref0 (container);
1787
1787
        _g_object_unref0 (grid);
1788
 
        block36_data_unref (_data36_);
1789
 
        _data36_ = NULL;
 
1788
        block35_data_unref (_data35_);
 
1789
        _data35_ = NULL;
1790
1790
        return self;
1791
1791
}
1792
1792