~ubuntu-branches/ubuntu/utopic/unity-greeter/utopic

« back to all changes in this revision

Viewing changes to src/greeter-list.c

  • Committer: Package Import Robot
  • Author(s): Michael Terry
  • Date: 2013-01-04 10:37:29 UTC
  • mto: This revision was merged to the branch mainline in revision 51.
  • Revision ID: package-import@ubuntu.com-20130104103729-ydal31wfuhirb8zb
Tags: upstream-13.04.0
ImportĀ upstreamĀ versionĀ 13.04.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* greeter-list.c generated by valac 0.16.1, the Vala compiler
 
1
/* greeter-list.c generated by valac 0.18.1, the Vala compiler
2
2
 * generated from greeter-list.vala, do not modify */
3
3
 
4
4
/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*-
336
336
static gint greeter_list_get_box_y (GreeterList* self);
337
337
gint greeter_list_get_position_y (GreeterList* self, gdouble position);
338
338
static gint greeter_list_real_get_position_y (GreeterList* self, gdouble position);
339
 
#define PROMPT_BOX_NAME_MARGIN_TOP 12
340
339
static void greeter_list_move_entry (GreeterList* self, PromptBox* entry, gdouble position);
341
340
void fadable_set_alpha (Fadable* self, gdouble alpha);
342
341
void prompt_box_set_position (PromptBox* self, gdouble value);
343
342
void greeter_list_greeter_box_size_allocate_cb (GreeterList* self, GtkAllocation* allocation);
344
343
static PromptBox* greeter_list_get_scrolling_entry (GreeterList* self);
345
 
static gboolean ___lambda35_ (GreeterList* self);
346
 
static gboolean ____lambda35__gsource_func (gpointer self);
 
344
static gboolean ___lambda33_ (GreeterList* self);
 
345
static gboolean ____lambda33__gsource_func (gpointer self);
347
346
gboolean dash_box_get_has_base (DashBox* self);
348
347
gdouble dash_box_get_base_alpha (DashBox* self);
349
348
static void greeter_list_animate_scrolling (GreeterList* self, gdouble progress);
391
390
void unity_greeter_authenticate (UnityGreeter* self, const gchar* userid);
392
391
void unity_greeter_authenticate_as_guest (UnityGreeter* self);
393
392
void background_set_draw_grid (Background* self, gboolean value);
394
 
void unity_greeter_start_session (UnityGreeter* self, const gchar* session);
 
393
void unity_greeter_start_session (UnityGreeter* self, const gchar* session, Background* bg);
395
394
gchar* greeter_list_get_lightdm_session (GreeterList* self);
396
395
static gchar* greeter_list_real_get_lightdm_session (GreeterList* self);
397
396
static void greeter_list_real_test_start_authentication (GreeterList* self);
406
405
static GObject * greeter_list_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
407
406
DashBox* dash_box_new (Background* bg);
408
407
DashBox* dash_box_construct (GType object_type, Background* bg);
409
 
static void _greeter_list___lambda36_ (GreeterList* self);
410
 
static void __greeter_list___lambda36__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 
408
static void _greeter_list___lambda34_ (GreeterList* self);
 
409
static void __greeter_list___lambda34__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
411
410
static void _greeter_list_greeter_box_size_allocate_cb_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self);
412
411
gdouble animate_timer_ease_out_quint (gdouble x);
413
412
static gdouble _animate_timer_ease_out_quint_animate_timer_easing_func (gdouble x, gpointer self);
527
526
        gint _tmp0_ = 0;
528
527
        gint _tmp1_ = 0;
529
528
        self = (GreeterList*) base;
530
 
        GTK_WIDGET_CLASS (greeter_list_parent_class)->get_preferred_height ((GtkWidget*) FADABLE_BOX (self), &_tmp0_, &_tmp1_);
 
529
        GTK_WIDGET_CLASS (greeter_list_parent_class)->get_preferred_height ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_FADABLE_BOX, FadableBox), &_tmp0_, &_tmp1_);
531
530
        _vala_min = _tmp0_;
532
531
        _vala_nat = _tmp1_;
533
532
        _vala_min = 0;
1330
1329
 
1331
1330
static gint greeter_list_real_get_position_y (GreeterList* self, gdouble position) {
1332
1331
        gint result = 0;
1333
 
        gint one_above_height;
1334
1332
        gint _tmp0_ = 0;
1335
1333
        gint box_height;
1336
1334
        gdouble offset = 0.0;
1337
1335
        gdouble _tmp1_;
1338
 
        gint _tmp12_ = 0;
1339
 
        gdouble _tmp13_;
1340
 
        gdouble _tmp14_ = 0.0;
1341
 
        one_above_height = grid_size + PROMPT_BOX_NAME_MARGIN_TOP;
 
1336
        gint _tmp8_;
 
1337
        gint _tmp9_;
 
1338
        gdouble _tmp10_;
 
1339
        gdouble _tmp11_ = 0.0;
1342
1340
        _tmp0_ = greeter_list_get_greeter_box_height_grids (self);
1343
 
        box_height = (_tmp0_ * grid_size) - PROMPT_BOX_NAME_MARGIN_TOP;
 
1341
        box_height = _tmp0_ * grid_size;
1344
1342
        _tmp1_ = position;
1345
 
        if (_tmp1_ < ((gdouble) (-1))) {
 
1343
        if (_tmp1_ < ((gdouble) 0)) {
1346
1344
                gdouble _tmp2_;
1347
 
                gint _tmp3_;
1348
1345
                _tmp2_ = position;
1349
 
                _tmp3_ = one_above_height;
1350
 
                offset = ((_tmp2_ + 1) * grid_size) - _tmp3_;
 
1346
                offset = _tmp2_ * grid_size;
1351
1347
        } else {
1352
 
                gdouble _tmp4_;
1353
 
                _tmp4_ = position;
1354
 
                if (_tmp4_ < ((gdouble) 0)) {
1355
 
                        gdouble _tmp5_;
1356
 
                        gint _tmp6_;
1357
 
                        _tmp5_ = position;
1358
 
                        _tmp6_ = one_above_height;
1359
 
                        offset = _tmp5_ * _tmp6_;
 
1348
                gdouble _tmp3_;
 
1349
                _tmp3_ = position;
 
1350
                if (_tmp3_ < ((gdouble) 1)) {
 
1351
                        gdouble _tmp4_;
 
1352
                        gint _tmp5_;
 
1353
                        _tmp4_ = position;
 
1354
                        _tmp5_ = box_height;
 
1355
                        offset = _tmp4_ * _tmp5_;
1360
1356
                } else {
1361
 
                        gdouble _tmp7_;
1362
 
                        _tmp7_ = position;
1363
 
                        if (_tmp7_ < ((gdouble) 1)) {
1364
 
                                gdouble _tmp8_;
1365
 
                                gint _tmp9_;
1366
 
                                _tmp8_ = position;
1367
 
                                _tmp9_ = box_height;
1368
 
                                offset = _tmp8_ * _tmp9_;
1369
 
                        } else {
1370
 
                                gdouble _tmp10_;
1371
 
                                gint _tmp11_;
1372
 
                                _tmp10_ = position;
1373
 
                                _tmp11_ = box_height;
1374
 
                                offset = ((_tmp10_ - 1) * grid_size) + _tmp11_;
1375
 
                        }
 
1357
                        gdouble _tmp6_;
 
1358
                        gint _tmp7_;
 
1359
                        _tmp6_ = position;
 
1360
                        _tmp7_ = box_height;
 
1361
                        offset = ((_tmp6_ - 1) * grid_size) + _tmp7_;
1376
1362
                }
1377
1363
        }
1378
 
        _tmp12_ = greeter_list_get_greeter_box_y (self);
1379
 
        _tmp13_ = offset;
1380
 
        _tmp14_ = round (_tmp13_);
1381
 
        result = _tmp12_ + ((gint) _tmp14_);
 
1364
        _tmp8_ = greeter_list_get_box_y (self);
 
1365
        _tmp9_ = _tmp8_;
 
1366
        _tmp10_ = offset;
 
1367
        _tmp11_ = round (_tmp10_);
 
1368
        result = _tmp9_ + ((gint) _tmp11_);
1382
1369
        return result;
1383
1370
}
1384
1371
 
1472
1459
}
1473
1460
 
1474
1461
 
1475
 
static gboolean ___lambda35_ (GreeterList* self) {
 
1462
static gboolean ___lambda33_ (GreeterList* self) {
1476
1463
        gboolean result = FALSE;
1477
1464
        greeter_list_move_names (self);
1478
1465
        result = FALSE;
1480
1467
}
1481
1468
 
1482
1469
 
1483
 
static gboolean ____lambda35__gsource_func (gpointer self) {
 
1470
static gboolean ____lambda33__gsource_func (gpointer self) {
1484
1471
        gboolean result;
1485
 
        result = ___lambda35_ (self);
 
1472
        result = ___lambda33_ (self);
1486
1473
        return result;
1487
1474
}
1488
1475
 
1511
1498
        }
1512
1499
        _tmp6_ = _tmp0_;
1513
1500
        if (_tmp6_) {
1514
 
                g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda35__gsource_func, g_object_ref (self), g_object_unref);
 
1501
                g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda33__gsource_func, g_object_ref (self), g_object_unref);
1515
1502
        }
1516
1503
        _tmp7_ = *allocation;
1517
1504
        _tmp8_ = _tmp7_.height;
1870
1857
        PromptBox* saved_entry;
1871
1858
        gboolean _tmp2_;
1872
1859
        self = (GreeterList*) base;
1873
 
        GTK_WIDGET_CLASS (greeter_list_parent_class)->realize ((GtkWidget*) FADABLE_BOX (self));
 
1860
        GTK_WIDGET_CLASS (greeter_list_parent_class)->realize ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_FADABLE_BOX, FadableBox));
1874
1861
        _tmp0_ = self->priv->_selected_entry;
1875
1862
        _tmp1_ = _g_object_ref0 (_tmp0_);
1876
1863
        saved_entry = _tmp1_;
1963
1950
        self = (GreeterList*) base;
1964
1951
        g_return_if_fail (allocation != NULL);
1965
1952
        _tmp0_ = *allocation;
1966
 
        GTK_WIDGET_CLASS (greeter_list_parent_class)->size_allocate ((GtkWidget*) FADABLE_BOX (self), &_tmp0_);
 
1953
        GTK_WIDGET_CLASS (greeter_list_parent_class)->size_allocate ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_FADABLE_BOX, FadableBox), &_tmp0_);
1967
1954
        _tmp1_ = gtk_widget_get_realized ((GtkWidget*) self);
1968
1955
        if (!_tmp1_) {
1969
1956
                return;
2053
2040
                                        DashBox* _tmp22_;
2054
2041
                                        _tmp21_ = child;
2055
2042
                                        _tmp22_ = self->greeter_box;
2056
 
                                        if (_tmp21_ != GTK_WIDGET (_tmp22_)) {
 
2043
                                        if (_tmp21_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GTK_TYPE_WIDGET, GtkWidget)) {
2057
2044
                                                GtkFixed* _tmp23_;
2058
2045
                                                GtkWidget* _tmp24_;
2059
2046
                                                cairo_t* _tmp25_;
2433
2420
        UnityGreeter* _tmp2_;
2434
2421
        gchar* _tmp3_ = NULL;
2435
2422
        gchar* _tmp4_;
 
2423
        Background* _tmp5_;
2436
2424
        g_return_if_fail (self != NULL);
2437
2425
        _tmp0_ = self->priv->_background;
2438
2426
        background_set_draw_grid (_tmp0_, FALSE);
2441
2429
        _tmp2_ = unity_greeter_singleton;
2442
2430
        _tmp3_ = greeter_list_get_lightdm_session (self);
2443
2431
        _tmp4_ = _tmp3_;
2444
 
        unity_greeter_start_session (_tmp2_, _tmp4_);
 
2432
        _tmp5_ = self->priv->_background;
 
2433
        unity_greeter_start_session (_tmp2_, _tmp4_, _tmp5_);
2445
2434
        _g_free0 (_tmp4_);
2446
2435
}
2447
2436
 
2689
2678
}
2690
2679
 
2691
2680
 
2692
 
static void _greeter_list___lambda36_ (GreeterList* self) {
 
2681
static void _greeter_list___lambda34_ (GreeterList* self) {
2693
2682
        gtk_widget_queue_draw ((GtkWidget*) self);
2694
2683
}
2695
2684
 
2696
2685
 
2697
 
static void __greeter_list___lambda36__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
2698
 
        _greeter_list___lambda36_ (self);
 
2686
static void __greeter_list___lambda34__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
 
2687
        _greeter_list___lambda34_ (self);
2699
2688
}
2700
2689
 
2701
2690
 
2723
2712
        GtkFixed* _tmp0_;
2724
2713
        GtkFixed* _tmp1_;
2725
2714
        GtkFixed* _tmp2_;
2726
 
        GtkFixed* _tmp3_;
2727
 
        Background* _tmp4_;
 
2715
        Background* _tmp3_;
 
2716
        DashBox* _tmp4_;
2728
2717
        DashBox* _tmp5_;
2729
2718
        DashBox* _tmp6_;
2730
2719
        DashBox* _tmp7_;
2731
2720
        DashBox* _tmp8_;
2732
 
        DashBox* _tmp9_;
2733
 
        DashBox* _tmp10_;
2734
 
        AnimateTimer* _tmp11_;
2735
 
        AnimateTimer* _tmp12_;
 
2721
        AnimateTimer* _tmp9_;
 
2722
        AnimateTimer* _tmp10_;
2736
2723
        parent_class = G_OBJECT_CLASS (greeter_list_parent_class);
2737
2724
        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
2738
 
        self = GREETER_LIST (obj);
 
2725
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_GREETER_LIST, GreeterList);
2739
2726
        g_object_set ((GtkWidget*) self, "can-focus", FALSE, NULL);
2740
2727
        gtk_event_box_set_visible_window ((GtkEventBox*) self, FALSE);
2741
2728
        _tmp0_ = (GtkFixed*) gtk_fixed_new ();
2742
 
        _tmp1_ = g_object_ref_sink (_tmp0_);
 
2729
        g_object_ref_sink (_tmp0_);
2743
2730
        _g_object_unref0 (self->priv->fixed);
2744
 
        self->priv->fixed = _tmp1_;
 
2731
        self->priv->fixed = _tmp0_;
 
2732
        _tmp1_ = self->priv->fixed;
 
2733
        gtk_widget_show ((GtkWidget*) _tmp1_);
2745
2734
        _tmp2_ = self->priv->fixed;
2746
 
        gtk_widget_show ((GtkWidget*) _tmp2_);
2747
 
        _tmp3_ = self->priv->fixed;
2748
 
        gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp3_);
2749
 
        _tmp4_ = self->priv->_background;
2750
 
        _tmp5_ = dash_box_new (_tmp4_);
2751
 
        _tmp6_ = g_object_ref_sink (_tmp5_);
 
2735
        gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp2_);
 
2736
        _tmp3_ = self->priv->_background;
 
2737
        _tmp4_ = dash_box_new (_tmp3_);
 
2738
        g_object_ref_sink (_tmp4_);
2752
2739
        _g_object_unref0 (self->greeter_box);
2753
 
        self->greeter_box = _tmp6_;
 
2740
        self->greeter_box = _tmp4_;
 
2741
        _tmp5_ = self->greeter_box;
 
2742
        g_signal_connect_object ((GObject*) _tmp5_, "notify::base-alpha", (GCallback) __greeter_list___lambda34__g_object_notify, self, 0);
 
2743
        _tmp6_ = self->greeter_box;
 
2744
        gtk_widget_show ((GtkWidget*) _tmp6_);
2754
2745
        _tmp7_ = self->greeter_box;
2755
 
        g_signal_connect_object ((GObject*) _tmp7_, "notify::base-alpha", (GCallback) __greeter_list___lambda36__g_object_notify, self, 0);
 
2746
        g_signal_connect_object ((GtkWidget*) _tmp7_, "size-allocate", (GCallback) _greeter_list_greeter_box_size_allocate_cb_gtk_widget_size_allocate, self, 0);
2756
2747
        _tmp8_ = self->greeter_box;
2757
 
        gtk_widget_show ((GtkWidget*) _tmp8_);
2758
 
        _tmp9_ = self->greeter_box;
2759
 
        g_signal_connect_object ((GtkWidget*) _tmp9_, "size-allocate", (GCallback) _greeter_list_greeter_box_size_allocate_cb_gtk_widget_size_allocate, self, 0);
2760
 
        _tmp10_ = self->greeter_box;
2761
 
        greeter_list_add_with_class (self, (GtkWidget*) _tmp10_);
2762
 
        _tmp11_ = animate_timer_new (_animate_timer_ease_out_quint_animate_timer_easing_func, NULL, ANIMATE_TIMER_FAST);
 
2748
        greeter_list_add_with_class (self, (GtkWidget*) _tmp8_);
 
2749
        _tmp9_ = animate_timer_new (_animate_timer_ease_out_quint_animate_timer_easing_func, NULL, ANIMATE_TIMER_FAST);
2763
2750
        _g_object_unref0 (self->priv->scroll_timer);
2764
 
        self->priv->scroll_timer = _tmp11_;
2765
 
        _tmp12_ = self->priv->scroll_timer;
2766
 
        g_signal_connect_object (_tmp12_, "animate", (GCallback) _greeter_list_animate_scrolling_animate_timer_animate, self, 0);
 
2751
        self->priv->scroll_timer = _tmp9_;
 
2752
        _tmp10_ = self->priv->scroll_timer;
 
2753
        g_signal_connect_object (_tmp10_, "animate", (GCallback) _greeter_list_animate_scrolling_animate_timer_animate, self, 0);
2767
2754
        return obj;
2768
2755
}
2769
2756
 
2826
2813
 
2827
2814
static void greeter_list_finalize (GObject* obj) {
2828
2815
        GreeterList * self;
2829
 
        self = GREETER_LIST (obj);
 
2816
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_GREETER_LIST, GreeterList);
2830
2817
        _g_object_unref0 (self->priv->_background);
2831
2818
        _g_object_unref0 (self->priv->_menubar);
2832
2819
        _g_object_unref0 (self->priv->_selected_entry);
2856
2843
 
2857
2844
static void _vala_greeter_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
2858
2845
        GreeterList * self;
2859
 
        self = GREETER_LIST (object);
 
2846
        self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_GREETER_LIST, GreeterList);
2860
2847
        switch (property_id) {
2861
2848
                case GREETER_LIST_BACKGROUND:
2862
2849
                g_value_set_object (value, greeter_list_get_background (self));
2885
2872
 
2886
2873
static void _vala_greeter_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
2887
2874
        GreeterList * self;
2888
 
        self = GREETER_LIST (object);
 
2875
        self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_GREETER_LIST, GreeterList);
2889
2876
        switch (property_id) {
2890
2877
                case GREETER_LIST_BACKGROUND:
2891
2878
                greeter_list_set_background (self, g_value_get_object (value));