# Path: PyDvi/Tools/EnumFactory.py
# def EnumFactory(cls_name, constant_names):
# 
#     """ Return an :class:`EnumMetaClass` instance, where *cls_name* is the class name and
#     *constant_names* is an iterable of constant's names.
#     """
# 
#     dict_ = {}
#     dict_['_size'] = len(constant_names)
#     for index, name in enumerate(constant_names):
#         dict_[str(name)] = index
# 
#     return EnumMetaClass(cls_name, (), dict_)
# 
# Path: PyDviGui/Tools/Math.py
# def rint(f):
#     return int(round(f))


import os
import platform
import sys
        import OpenGL.GL as GL
from PyQt4 import QtCore, QtGui
from PyDvi.Tools.EnumFactory import EnumFactory
from .Math import rint
        self.cpu_khz = self._get_cpu_khz()
        self.cpu_mhz = rint(self._get_cpu_khz()/float(1000))
        
        # RAM
        self.memory_size_kb = self._get_memory_size_kb()
        self.memory_size_mb = rint(self.memory_size_kb/float(1024))
        
        # Screen
        try:
            application = QtGui.QApplication.instance()
            self.desktop = application.desktop()
            self.number_of_screens = self.desktop.screenCount() 
        except:
            self.desktop = None
            self.number_of_screens = 0
        self.screens = []
        for i in xrange(self.number_of_screens):
            self.screens.append(Screen(self, i))
        
        # OpenGL
        self.gl_renderer = None
        self.gl_version = None
        self.gl_vendor = None
        self.gl_extensions = None

    ##############################################

    def _get_os(self):

        if os.name in 'nt':

# Path: PyDvi/Tools/EnumFactory.py
# def EnumFactory(cls_name, constant_names):
# 
#     """ Return an :class:`EnumMetaClass` instance, where *cls_name* is the class name and
#     *constant_names* is an iterable of constant's names.
#     """
# 
#     dict_ = {}
#     dict_['_size'] = len(constant_names)
#     for index, name in enumerate(constant_names):
#         dict_[str(name)] = index
# 
#     return EnumMetaClass(cls_name, (), dict_)
# 
# Path: PyDviGui/Tools/Math.py
# def rint(f):
#     return int(round(f))


# Path: PyDviGui/Tools/Platform.py
import os
import platform
import sys
        import OpenGL.GL as GL
from PyQt4 import QtCore, QtGui
from PyDvi.Tools.EnumFactory import EnumFactory
from .Math import rint

        self.cpu_khz = self._get_cpu_khz()
        self.cpu_mhz = rint(self._get_cpu_khz()/float(1000))
        
        # RAM
        self.memory_size_kb = self._get_memory_size_kb()
        self.memory_size_mb = rint(self.memory_size_kb/float(1024))
        
        # Screen
        try:
            application = QtGui.QApplication.instance()
            self.desktop = application.desktop()
            self.number_of_screens = self.desktop.screenCount() 
        except:
            self.desktop = None
            self.number_of_screens = 0
        self.screens = []
        for i in xrange(self.number_of_screens):
            self.screens.append(Screen(self, i))
        
        # OpenGL
        self.gl_renderer = None
        self.gl_version = None
        self.gl_vendor = None
        self.gl_extensions = None

    ##############################################

    def _get_os(self):

        if os.name in 'nt':

            return platform_enum.windows