# Warning: this file is automatically generated. Do not edit.

# pyopenxr version is based on openxr version...
# except the patch number is:
#   100 * openxr patch number + pyopenxr patch number

XR_VERSION_MAJOR = 1
XR_VERSION_MINOR = 0
XR_VERSION_PATCH = 25
XR_CURRENT_API_VERSION_STRING = "1.0.25"

PYOPENXR_VERSION_MAJOR = 1
PYOPENXR_VERSION_MINOR = 0
PYOPENXR_VERSION_PATCH = 2502
PYOPENXR_VERSION_PATCH_INCREMENTAL = 2
PYOPENXR_VERSION_SUFFIX = ""
PYOPENXR_VERSION = "1.0.2502"


class Version(object):
    def __init__(self, major: int = 0, minor: int = None, patch: int = None):
        if minor is None and patch is None and major > 0xffff:
            # major argument is actually a packed xr.VersionNumber
            patch = major & 0xffffffff
            minor = (major >> 32) & 0xffff
            major = (major >> 48) & 0xffff
        if minor is None:
            minor = 0
        if patch is None:
            patch = 0
        self.major = major
        self.minor = minor
        self.patch = patch

    def __index__(self) -> int:
        """Packed xr.VersionNumber"""
        return (((int(self.major) & 0xffff) << 48) 
                | ((int(self.minor) & 0xffff) << 32) 
                | (int(self.patch) & 0xffffffff))

    def __int__(self) -> int:
        return self.__index__()

    def number(self) -> int:
        """Packed xr.VersionNumber"""
        return self.__index__()

    def __str__(self):
        return f"{self.major}.{self.minor}.{self.patch}"


XR_CURRENT_API_VERSION = Version(XR_VERSION_MAJOR, XR_VERSION_MINOR, XR_VERSION_PATCH)
PYOPENXR_CURRENT_API_VERSION = Version(
    PYOPENXR_VERSION_MAJOR,
    PYOPENXR_VERSION_MINOR,
    PYOPENXR_VERSION_PATCH
)


__version__ = PYOPENXR_VERSION

__all__ = [
    "PYOPENXR_CURRENT_API_VERSION",
    "PYOPENXR_VERSION_MAJOR",
    "PYOPENXR_VERSION_MINOR",
    "PYOPENXR_VERSION_PATCH",
    "PYOPENXR_VERSION_PATCH_INCREMENTAL",
    "PYOPENXR_VERSION_SUFFIX",
    "PYOPENXR_VERSION",
    "Version",
    "XR_CURRENT_API_VERSION",
    "XR_VERSION_MAJOR",
    "XR_VERSION_MINOR",
    "XR_VERSION_PATCH",
]
