~ubuntu-branches/ubuntu/precise/evolution/precise

« back to all changes in this revision

Viewing changes to widgets/misc/e-map.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-09-08 09:38:57 UTC
  • mfrom: (1.1.84 upstream)
  • Revision ID: package-import@ubuntu.com-20110908093857-6lfl04ke2ns3kx2o
Tags: 3.1.91-0ubuntu1
* New upstream release. (LP: #843769)
* debian/control: bump e-d-s Build-Depends to 3.1.91. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
}
156
156
 
157
157
static void
158
 
e_map_tween_destroy (EMap *map, EMapTween *tween)
 
158
e_map_tween_destroy (EMap *map,
 
159
                     EMapTween *tween)
159
160
{
160
161
        map->priv->tweens = g_slist_remove (map->priv->tweens, tween);
161
162
        g_slice_free (EMapTween, tween);
313
314
}
314
315
 
315
316
static void
316
 
e_map_tweens_compute_matrix (EMap *map, cairo_matrix_t *matrix)
 
317
e_map_tweens_compute_matrix (EMap *map,
 
318
                             cairo_matrix_t *matrix)
317
319
{
318
320
        GSList *walk;
319
321
        gdouble zoom, x, y, latitude, longitude, effect;
348
350
/* GtkScrollable implementation */
349
351
 
350
352
static void
351
 
e_map_adjustment_changed (GtkAdjustment *adjustment, EMap *map)
 
353
e_map_adjustment_changed (GtkAdjustment *adjustment,
 
354
                          EMap *map)
352
355
{
353
356
        EMapPrivate *priv = map->priv;
354
357
 
420
423
}
421
424
 
422
425
static void
423
 
e_map_set_hadjustment (EMap *map, GtkAdjustment *adjustment)
 
426
e_map_set_hadjustment (EMap *map,
 
427
                       GtkAdjustment *adjustment)
424
428
{
425
429
        EMapPrivate *priv = map->priv;
426
430
 
447
451
}
448
452
 
449
453
static void
450
 
e_map_set_vadjustment (EMap *map, GtkAdjustment *adjustment)
 
454
e_map_set_vadjustment (EMap *map,
 
455
                       GtkAdjustment *adjustment)
451
456
{
452
457
        EMapPrivate *priv = map->priv;
453
458
 
479
484
 
480
485
static void
481
486
e_map_set_property (GObject *object,
482
 
                    guint prop_id,
 
487
                    guint property_id,
483
488
                    const GValue *value,
484
489
                    GParamSpec *pspec)
485
490
{
487
492
 
488
493
        map = E_MAP (object);
489
494
 
490
 
        switch (prop_id) {
 
495
        switch (property_id) {
491
496
        case PROP_HADJUSTMENT:
492
497
                e_map_set_hadjustment (map, g_value_get_object (value));
493
498
                break;
504
509
                break;
505
510
 
506
511
        default:
507
 
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 
512
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
508
513
                break;
509
514
        }
510
515
}
511
516
 
512
517
static void
513
518
e_map_get_property (GObject *object,
514
 
                    guint prop_id,
 
519
                    guint property_id,
515
520
                    GValue *value,
516
521
                    GParamSpec *pspec)
517
522
{
519
524
 
520
525
        map = E_MAP (object);
521
526
 
522
 
        switch (prop_id) {
 
527
        switch (property_id) {
523
528
        case PROP_HADJUSTMENT:
524
529
                g_value_set_object (value, map->priv->hadjustment);
525
530
                break;
534
539
                break;
535
540
 
536
541
        default:
537
 
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 
542
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
538
543
                break;
539
544
        }
540
545
}
618
623
}
619
624
 
620
625
static void
621
 
e_map_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural)
 
626
e_map_get_preferred_width (GtkWidget *widget,
 
627
                           gint *minimum,
 
628
                           gint *natural)
622
629
{
623
630
        EMap *map;
624
631
 
633
640
}
634
641
 
635
642
static void
636
 
e_map_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural)
 
643
e_map_get_preferred_height (GtkWidget *widget,
 
644
                            gint *minimum,
 
645
                            gint *natural)
637
646
{
638
647
        EMap *view;
639
648
        EMapPrivate *priv;
650
659
}
651
660
 
652
661
static void
653
 
e_map_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 
662
e_map_size_allocate (GtkWidget *widget,
 
663
                     GtkAllocation *allocation)
654
664
{
655
665
        EMap *map;
656
666
 
680
690
}
681
691
 
682
692
static gboolean
683
 
e_map_draw (GtkWidget *widget, cairo_t *cr)
 
693
e_map_draw (GtkWidget *widget,
 
694
            cairo_t *cr)
684
695
{
685
696
        EMap *map;
686
697
        cairo_matrix_t matrix;
704
715
}
705
716
 
706
717
static gint
707
 
e_map_button_press (GtkWidget *widget, GdkEventButton *event)
 
718
e_map_button_press (GtkWidget *widget,
 
719
                    GdkEventButton *event)
708
720
{
709
721
        if (!gtk_widget_has_focus (widget)) gtk_widget_grab_focus (widget);
710
722
                return TRUE;
711
723
}
712
724
 
713
725
static gint
714
 
e_map_button_release (GtkWidget *widget, GdkEventButton *event)
 
726
e_map_button_release (GtkWidget *widget,
 
727
                      GdkEventButton *event)
715
728
{
716
729
        if (event->button != 1) return FALSE;
717
730
 
720
733
}
721
734
 
722
735
static gint
723
 
e_map_motion (GtkWidget *widget, GdkEventMotion *event)
 
736
e_map_motion (GtkWidget *widget,
 
737
              GdkEventMotion *event)
724
738
{
725
739
        return FALSE;
726
740
}
934
948
}
935
949
 
936
950
static void
937
 
e_map_set_zoom (EMap *map, EMapZoomState zoom)
 
951
e_map_set_zoom (EMap *map,
 
952
                EMapZoomState zoom)
938
953
{
939
954
        if (map->priv->zoom_state == zoom)
940
955
                return;
986
1001
}
987
1002
 
988
1003
void
989
 
e_map_set_smooth_zoom (EMap *map, gboolean state)
 
1004
e_map_set_smooth_zoom (EMap *map,
 
1005
                       gboolean state)
990
1006
{
991
1007
        ((EMapPrivate *) map->priv)->smooth_zoom = state;
992
1008
}
1040
1056
}
1041
1057
 
1042
1058
void
1043
 
e_map_remove_point (EMap *map, EMapPoint *point)
 
1059
e_map_remove_point (EMap *map,
 
1060
                    EMapPoint *point)
1044
1061
{
1045
1062
        g_ptr_array_remove (map->priv->points, point);
1046
1063
 
1094
1111
}
1095
1112
 
1096
1113
void
1097
 
e_map_point_set_data (EMapPoint *point, gpointer data)
 
1114
e_map_point_set_data (EMapPoint *point,
 
1115
                      gpointer data)
1098
1116
{
1099
1117
        point->user_data = data;
1100
1118
}
1106
1124
}
1107
1125
 
1108
1126
gboolean
1109
 
e_map_point_is_in_view (EMap *map, EMapPoint *point)
 
1127
e_map_point_is_in_view (EMap *map,
 
1128
                        EMapPoint *point)
1110
1129
{
1111
1130
        GtkAllocation allocation;
1112
1131
        gdouble x, y;
1165
1184
}
1166
1185
 
1167
1186
static gint
1168
 
load_map_background (EMap *map, gchar *name)
 
1187
load_map_background (EMap *map,
 
1188
                     gchar *name)
1169
1189
{
1170
1190
        GdkPixbuf *pb0;
1171
1191
 
1251
1271
/* Redraw point in client surface */
1252
1272
 
1253
1273
static void
1254
 
update_render_point (EMap *map, EMapPoint *point)
 
1274
update_render_point (EMap *map,
 
1275
                     EMapPoint *point)
1255
1276
{
1256
1277
        cairo_t *cr;
1257
1278
        gdouble px, py;
1295
1316
/* Repaint point on X server */
1296
1317
 
1297
1318
static void
1298
 
repaint_point (EMap *map, EMapPoint *point)
 
1319
repaint_point (EMap *map,
 
1320
               EMapPoint *point)
1299
1321
{
1300
1322
        gdouble px, py;
1301
1323
 
1310
1332
}
1311
1333
 
1312
1334
static void
1313
 
center_at (EMap *map, gdouble longitude, gdouble latitude)
 
1335
center_at (EMap *map,
 
1336
           gdouble longitude,
 
1337
           gdouble latitude)
1314
1338
{
1315
1339
        GtkAllocation allocation;
1316
1340
        gint pb_width, pb_height;
1335
1359
/* Scrolls the view to the specified offsets.  Does not perform range checking!  */
1336
1360
 
1337
1361
static void
1338
 
scroll_to (EMap *map, gint x, gint y)
 
1362
scroll_to (EMap *map,
 
1363
           gint x,
 
1364
           gint y)
1339
1365
{
1340
1366
        gint xofs, yofs;
1341
1367
 
1354
1380
}
1355
1381
 
1356
1382
static void
1357
 
set_scroll_area (EMap *view, gint width, gint height)
 
1383
set_scroll_area (EMap *view,
 
1384
                 gint width,
 
1385
                 gint height)
1358
1386
{
1359
1387
        EMapPrivate *priv;
1360
1388
        GtkAllocation allocation;