GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 2 / 0 / 2
Functions: 100.0% 1 / 0 / 1
Branches: 46.7% 14 / 0 / 30

shumate/shumate-tile.h
Line Branch Exec Source
1 /*
2 * Copyright (C) 2008-2009 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
3 * Copyright (C) 2010-2013 Jiri Techet <techet@gmail.com>
4 * Copyright (C) 2019 Marcus Lundblad <ml@update.uu.se>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library 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 GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef SHUMATE_MAP_TILE_H
22 #define SHUMATE_MAP_TILE_H
23
24 #include <glib.h>
25 #include <glib-object.h>
26 #include <gdk/gdk.h>
27
28 #include <shumate/shumate-version.h>
29
30 G_BEGIN_DECLS
31
32 #define SHUMATE_TYPE_TILE shumate_tile_get_type ()
33
14/30
None:
✓ Branch 9 → 10 taken 2 times.
✗ Branch 9 → 11 not taken.
✓ Branch 11 → 12 taken 2 times.
✗ Branch 11 → 13 not taken.
✓ Branch 15 → 16 taken 2 times.
✗ Branch 15 → 17 not taken.
✓ Branch 16 → 17 taken 2 times.
✗ Branch 16 → 18 not taken.
✓ Branch 17 → 18 taken 2 times.
✗ Branch 17 → 19 not taken.
✓ Branch 18 → 19 taken 2 times.
✗ Branch 18 → 20 not taken.
✓ Branch 20 → 21 taken 2 times.
✗ Branch 20 → 22 not taken.
✓ Branch 25 → 26 taken 2 times.
✗ Branch 25 → 27 not taken.
✓ Branch 27 → 28 taken 4 times.
✗ Branch 27 → 29 not taken.
✓ Branch 29 → 30 taken 4 times.
✗ Branch 29 → 31 not taken.
✓ Branch 31 → 32 taken 4 times.
✗ Branch 31 → 33 not taken.
SHUMATE_IS_TILE:
✓ Branch 3 → 4 taken 124 times.
✗ Branch 3 → 7 not taken.
✓ Branch 4 → 5 taken 124 times.
✗ Branch 4 → 6 not taken.
✗ Branch 5 → 6 not taken.
✓ Branch 5 → 7 taken 124 times.
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 34 not taken.
136 G_DECLARE_FINAL_TYPE (ShumateTile, shumate_tile, SHUMATE, TILE, GObject)
34
35 /**
36 * ShumateState:
37 * @SHUMATE_STATE_NONE: Initial or undefined state
38 * @SHUMATE_STATE_LOADING: Tile is loading
39 * @SHUMATE_STATE_LOADED: Tile is loaded but not yet displayed
40 * @SHUMATE_STATE_DONE: Tile loading finished. Also used to inform map sources
41 * that tile loading has been cancelled.
42 *
43 * Tile loading state.
44 */
45 typedef enum
46 {
47 SHUMATE_STATE_NONE,
48 SHUMATE_STATE_LOADING,
49 SHUMATE_STATE_LOADED,
50 SHUMATE_STATE_DONE
51 } ShumateState;
52
53 ShumateTile *shumate_tile_new (void);
54 ShumateTile *shumate_tile_new_full (guint x,
55 guint y,
56 guint size,
57 guint zoom_level);
58
59 guint shumate_tile_get_x (ShumateTile *self);
60 void shumate_tile_set_x (ShumateTile *self,
61 guint x);
62
63 guint shumate_tile_get_y (ShumateTile *self);
64 void shumate_tile_set_y (ShumateTile *self,
65 guint y);
66
67 guint shumate_tile_get_zoom_level (ShumateTile *self);
68 void shumate_tile_set_zoom_level (ShumateTile *self,
69 guint zoom_level);
70
71 guint shumate_tile_get_size (ShumateTile *self);
72 void shumate_tile_set_size (ShumateTile *self,
73 guint size);
74
75 ShumateState shumate_tile_get_state (ShumateTile *self);
76 void shumate_tile_set_state (ShumateTile *self,
77 ShumateState state);
78
79 gboolean shumate_tile_get_fade_in (ShumateTile *self);
80 void shumate_tile_set_fade_in (ShumateTile *self,
81 gboolean fade_in);
82
83 GdkPaintable *shumate_tile_get_paintable (ShumateTile *self);
84 void shumate_tile_set_paintable (ShumateTile *self,
85 GdkPaintable *paintable);
86
87 SHUMATE_AVAILABLE_IN_1_1
88 double shumate_tile_get_scale_factor (ShumateTile *self);
89 SHUMATE_AVAILABLE_IN_1_1
90 void shumate_tile_set_scale_factor (ShumateTile *self,
91 double scale_factor);
92
93 G_END_DECLS
94
95 #endif /* SHUMATE_MAP_TILE_H */
96