/* Clapper GTK Integration Library
 * Copyright (C) 2024 Rafał Dzięgiel <rafostar.github@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#pragma once

#if !defined(__CLAPPER_GTK_INSIDE__) && !defined(CLAPPER_GTK_COMPILATION)
#error "Only <clapper-gtk/clapper-gtk.h> can be included directly."
#endif

/**
 * CLAPPER_GTK_MAJOR_VERSION:
 *
 * ClapperGtk major version component
 */
#define CLAPPER_GTK_MAJOR_VERSION            (0)

/**
 * CLAPPER_GTK_MINOR_VERSION:
 *
 * ClapperGtk minor version component
 */
#define CLAPPER_GTK_MINOR_VERSION            (6)

/**
 * CLAPPER_GTK_MICRO_VERSION:
 *
 * ClapperGtk micro version component
 */
#define CLAPPER_GTK_MICRO_VERSION            (1)

/**
 * CLAPPER_GTK_VERSION:
 *
 * ClapperGtk version
 */
#define CLAPPER_GTK_VERSION                  (0.6.1)

/**
 * CLAPPER_GTK_VERSION_S:
 *
 * ClapperGtk version, encoded as a string
 */
#define CLAPPER_GTK_VERSION_S                "0.6.1"

#define CLAPPER_GTK_ENCODE_VERSION(major,minor,micro) \
    ((major) << 24 | (minor) << 16 | (micro) << 8)

/**
 * CLAPPER_GTK_VERSION_HEX:
 *
 * ClapperGtk version, encoded as an hexadecimal number, useful for integer comparisons.
 */
#define CLAPPER_GTK_VERSION_HEX \
    (CLAPPER_GTK_ENCODE_VERSION (CLAPPER_GTK_MAJOR_VERSION, CLAPPER_GTK_MINOR_VERSION, CLAPPER_GTK_MICRO_VERSION))

#define CLAPPER_GTK_CHECK_VERSION(major, minor, micro)                               \
    (CLAPPER_GTK_MAJOR_VERSION > (major) ||                                          \
    (CLAPPER_GTK_MAJOR_VERSION == (major) && CLAPPER_GTK_MINOR_VERSION > (minor)) || \
    (CLAPPER_GTK_MAJOR_VERSION == (major) && CLAPPER_GTK_MINOR_VERSION == (minor) && \
    CLAPPER_GTK_MICRO_VERSION >= (micro)))
