Branch data Line data Source code
1 : : /*
2 : : * Copyright (C) 2021 James Westman <james@jwestman.net>
3 : : *
4 : : * This library is free software; you can redistribute it and/or
5 : : * modify it under the terms of the GNU Lesser General Public
6 : : * License as published by the Free Software Foundation; either
7 : : * version 2.1 of the License, or (at your option) any later version.
8 : : *
9 : : * This library is distributed in the hope that it will be useful,
10 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 : : * Lesser General Public License for more details.
13 : : *
14 : : * You should have received a copy of the GNU Lesser General Public
15 : : * License along with this library; if not, see <https://www.gnu.org/licenses/>.
16 : : */
17 : :
18 : :
19 : : #pragma once
20 : :
21 : : #include <gio/gio.h>
22 : : #include "shumate-data-source-request.h"
23 : :
24 : : G_BEGIN_DECLS
25 : :
26 : : #define SHUMATE_TYPE_DATA_SOURCE (shumate_data_source_get_type())
27 : :
28 [ + - + - : 105 : G_DECLARE_DERIVABLE_TYPE (ShumateDataSource, shumate_data_source, SHUMATE, DATA_SOURCE, GObject)
+ - - - ]
29 : :
30 : : struct _ShumateDataSourceClass
31 : : {
32 : : GObjectClass parent_class;
33 : :
34 : : void (*get_tile_data_async) (ShumateDataSource *self,
35 : : int x,
36 : : int y,
37 : : int zoom_level,
38 : : GCancellable *cancellable,
39 : : GAsyncReadyCallback callback,
40 : : gpointer user_data);
41 : : GBytes *(*get_tile_data_finish) (ShumateDataSource *self,
42 : : GAsyncResult *result,
43 : : GError **error);
44 : :
45 : : ShumateDataSourceRequest *(*start_request) (ShumateDataSource *self,
46 : : int x,
47 : : int y,
48 : : int zoom_level,
49 : : GCancellable *cancellable);
50 : :
51 : : /*< private >*/
52 : : gpointer padding[15];
53 : : };
54 : :
55 : :
56 : : void shumate_data_source_get_tile_data_async (ShumateDataSource *self,
57 : : int x,
58 : : int y,
59 : : int zoom_level,
60 : : GCancellable *cancellable,
61 : : GAsyncReadyCallback callback,
62 : : gpointer user_data);
63 : : GBytes *shumate_data_source_get_tile_data_finish (ShumateDataSource *self,
64 : : GAsyncResult *result,
65 : : GError **error);
66 : :
67 : : ShumateDataSourceRequest *shumate_data_source_start_request (ShumateDataSource *self,
68 : : int x,
69 : : int y,
70 : : int zoom_level,
71 : : GCancellable *cancellable);
72 : :
73 : : guint shumate_data_source_get_min_zoom_level (ShumateDataSource *self);
74 : : void shumate_data_source_set_min_zoom_level (ShumateDataSource *self,
75 : : guint zoom_level);
76 : : guint shumate_data_source_get_max_zoom_level (ShumateDataSource *self);
77 : : void shumate_data_source_set_max_zoom_level (ShumateDataSource *self,
78 : : guint zoom_level);
79 : :
80 : : G_END_DECLS
|