Branch data Line data Source code
1 : : /* 2 : : * Copyright (C) 2023 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 : : #pragma once 19 : : 20 : : #include "glib-object.h" 21 : : 22 : : typedef struct 23 : : { 24 : : int x; 25 : : int y; 26 : : int zoom; 27 : : } ShumateGridPosition; 28 : : 29 : : #define SHUMATE_GRID_POSITION_INIT(x, y, zoom) ((ShumateGridPosition) {x, y, zoom}) 30 : : 31 : : void shumate_grid_position_init (ShumateGridPosition *self, 32 : : int x, 33 : : int y, 34 : : int zoom); 35 : : ShumateGridPosition * shumate_grid_position_new (int x, 36 : : int y, 37 : : int zoom); 38 : : ShumateGridPosition *shumate_grid_position_copy (ShumateGridPosition *pos); 39 : : 40 : : guint shumate_grid_position_hash (gconstpointer pointer); 41 : : gboolean shumate_grid_position_equal (gconstpointer a, gconstpointer b); 42 : : void shumate_grid_position_free (gpointer pointer); 43 : : 44 [ # # ]: 0 : G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShumateGridPosition, shumate_grid_position_free);