# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2016 EventGhost Project <http://www.eventghost.org/>
#
# EventGhost is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 2 of the License, or (at your option)
# any later version.
#
# EventGhost 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 General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with EventGhost. If not, see <http://www.gnu.org/licenses/>.

import sys
import wx

PI = wx.PlatformInformation()
# Windows 10 /  Server 2016
WIN_10 = PI.CheckOSVersion(10, 0)
WIN_8 = False
WIN_7 = False
WIN_VISTA = False
WIN_XP = False

if not WIN_10:
    # Windows 8, 8.1 / Server 2012, 2012 R2 / RT, RT 8.1
    WIN_8 = PI.CheckOSVersion(6, 2) or PI.CheckOSVersion(6, 3)
if True not in (WIN_10, WIN_8):
    # Windows 7 / Server 2008 R2
    WIN_7 = PI.CheckOSVersion(6, 1)
if True not in (WIN_10, WIN_8, WIN_7):
    # Windows Vista / Server 2008
    WIN_VISTA = PI.CheckOSVersion(6, 0)
if True not in (WIN_10, WIN_8, WIN_7, WIN_VISTA):
    # Windows XP x86, x64 / Server 2003, 2003 R2 / Tablet PC, MCE
    WIN_XP = PI.CheckOSVersion(5, 1) or PI.CheckOSVersion(5, 2)


def IsXP():
    return WIN_XP


def IsVista():
    return WIN_VISTA


def Is8():
    return WIN_8


def Is7():
    return WIN_7


def Is10():
    return WIN_10

WindowsVersion = sys.modules[__name__]
