# Path: pywinauto/base_types.py
# class Structure(Struct, StructureMixIn):
# 
#     """Override the Structure class from ctypes to add printing and comparison"""
# 
#     pass
# 
# Path: pywinauto/base_types.py
# class PointIteratorMixin(object):
# 
#     """Add iterator functionality to POINT structure"""
# 
#     x = None
#     y = None
# 
#     def __iter__(self):
#         """Allow iteration through coordinates"""
#         yield self.x
#         yield self.y
# 
#     def __getitem__(self, key):
#         """Allow indexing of coordinates"""
#         if key == 0 or key == -2:
#             return self.x
#         elif key == 1 or key == -1:
#             return self.y
#         else:
#             raise IndexError("Illegal index")
# 
# Path: pywinauto/base_types.py
# class RectExtMixin(object):
# 
#     """Wrap the RECT structure and add extra functionality"""
# 
#     # To be initiated by OS-specific types
#     _RECT = type(None)
#     _POINT = type(None)
# 
#     # ----------------------------------------------------------------
#     def __init__(self, other=0, top=0, right=0, bottom=0):
#         """Provide a constructor for _RECT structures
# 
#         A _RECT can be constructed by:
#         - Another RECT (each value will be copied)
#         - Values for left, top, right and bottom
# 
#         e.g. my_rect = _RECT(otherRect)
#         or   my_rect = _RECT(10, 20, 34, 100)
#         """
#         if isinstance(other, self._RECT):
#             self.left = other.left
#             self.right = other.right
#             self.top = other.top
#             self.bottom = other.bottom
#         else:
#             #if not isinstance(other, (int, long)):
#             #    print type(self), type(other), other
#             long_int = six.integer_types[-1]
#             self.left = long_int(other)
#             self.right = long_int(right)
#             self.top = long_int(top)
#             self.bottom = long_int(bottom)
# 
#     # ----------------------------------------------------------------
#     def __str__(self):
#         """Return a string representation of the _RECT"""
#         return "(L%d, T%d, R%d, B%d)" % (
#             self.left, self.top, self.right, self.bottom)
# 
#     # ----------------------------------------------------------------
#     def __repr__(self):
#         """Return some representation of the _RECT"""
#         return "<RECT L%d, T%d, R%d, B%d>" % (
#             self.left, self.top, self.right, self.bottom)
# 
#     # ----------------------------------------------------------------
#     def __iter__(self):
#         """Allow iteration through coordinates"""
#         yield self.left
#         yield self.top
#         yield self.right
#         yield self.bottom
# 
#     # ----------------------------------------------------------------
#     def __sub__(self, other):
#         """Return a new rectangle which is offset from the one passed in"""
#         new_rect = self._RECT()
# 
#         new_rect.left = self.left - other.left
#         new_rect.right = self.right - other.left
# 
#         new_rect.top = self.top - other.top
#         new_rect.bottom = self.bottom - other.top
# 
#         return new_rect
# 
#     # ----------------------------------------------------------------
#     def __add__(self, other):
#         """Allow two rects to be added using +"""
#         new_rect = self._RECT()
# 
#         new_rect.left = self.left + other.left
#         new_rect.right = self.right + other.left
# 
#         new_rect.top = self.top + other.top
#         new_rect.bottom = self.bottom + other.top
# 
#         return new_rect
# 
#     # ----------------------------------------------------------------
#     def width(self):
#         """Return the width of the rect"""
#         return self.right - self.left
# 
#     # ----------------------------------------------------------------
#     def height(self):
#         """Return the height of the rect"""
#         return self.bottom - self.top
# 
#     # ----------------------------------------------------------------
#     def mid_point(self):
#         """Return a POINT structure representing the mid point"""
#         pt = self._POINT()
#         pt.x = self.left + int(float(self.width()) / 2.)
#         pt.y = self.top + int(float(self.height()) / 2.)
#         return pt
# 
#     __reduce__ = _reduce
# 
# Path: pywinauto/backend.py
# class Singleton(type):
# 
#     """
#     Singleton metaclass implementation from StackOverflow
# 
#     http://stackoverflow.com/q/6760685/3648361
#     """
# 
#     _instances = {}
#     def __call__(cls, *args, **kwargs):
#         if cls not in cls._instances:
#             cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
#         return cls._instances[cls]


import subprocess
import six
from ctypes import c_int, c_bool, c_char_p, c_char, POINTER, c_uint, c_uint32, c_uint64, c_double, c_short, \
    create_string_buffer, cdll, pointer, c_void_p, CFUNCTYPE
from functools import wraps
from ..base_types import Structure
from ..base_types import PointIteratorMixin
from ..base_types import RectExtMixin
from ..backend import Singleton
    _fields_ = [
        ('g_type_instance', _GTypeInstance),
        ('ref_count', c_uint),
        ('qdata', POINTER(_GData)),
    ]


class _GError(Structure):
    _fields_ = [
        ('domain', c_uint32),
        ('code', c_int),
        ('message', c_char_p),
    ]


class _GArray(Structure):
    _fields_ = [
        ('data', POINTER(c_char)),
        ('len', c_uint32),
    ]


class _GHashTable(Structure):
    pass


class _GPtrArray(Structure):
    pass



# Path: pywinauto/base_types.py
# class Structure(Struct, StructureMixIn):
# 
#     """Override the Structure class from ctypes to add printing and comparison"""
# 
#     pass
# 
# Path: pywinauto/base_types.py
# class PointIteratorMixin(object):
# 
#     """Add iterator functionality to POINT structure"""
# 
#     x = None
#     y = None
# 
#     def __iter__(self):
#         """Allow iteration through coordinates"""
#         yield self.x
#         yield self.y
# 
#     def __getitem__(self, key):
#         """Allow indexing of coordinates"""
#         if key == 0 or key == -2:
#             return self.x
#         elif key == 1 or key == -1:
#             return self.y
#         else:
#             raise IndexError("Illegal index")
# 
# Path: pywinauto/base_types.py
# class RectExtMixin(object):
# 
#     """Wrap the RECT structure and add extra functionality"""
# 
#     # To be initiated by OS-specific types
#     _RECT = type(None)
#     _POINT = type(None)
# 
#     # ----------------------------------------------------------------
#     def __init__(self, other=0, top=0, right=0, bottom=0):
#         """Provide a constructor for _RECT structures
# 
#         A _RECT can be constructed by:
#         - Another RECT (each value will be copied)
#         - Values for left, top, right and bottom
# 
#         e.g. my_rect = _RECT(otherRect)
#         or   my_rect = _RECT(10, 20, 34, 100)
#         """
#         if isinstance(other, self._RECT):
#             self.left = other.left
#             self.right = other.right
#             self.top = other.top
#             self.bottom = other.bottom
#         else:
#             #if not isinstance(other, (int, long)):
#             #    print type(self), type(other), other
#             long_int = six.integer_types[-1]
#             self.left = long_int(other)
#             self.right = long_int(right)
#             self.top = long_int(top)
#             self.bottom = long_int(bottom)
# 
#     # ----------------------------------------------------------------
#     def __str__(self):
#         """Return a string representation of the _RECT"""
#         return "(L%d, T%d, R%d, B%d)" % (
#             self.left, self.top, self.right, self.bottom)
# 
#     # ----------------------------------------------------------------
#     def __repr__(self):
#         """Return some representation of the _RECT"""
#         return "<RECT L%d, T%d, R%d, B%d>" % (
#             self.left, self.top, self.right, self.bottom)
# 
#     # ----------------------------------------------------------------
#     def __iter__(self):
#         """Allow iteration through coordinates"""
#         yield self.left
#         yield self.top
#         yield self.right
#         yield self.bottom
# 
#     # ----------------------------------------------------------------
#     def __sub__(self, other):
#         """Return a new rectangle which is offset from the one passed in"""
#         new_rect = self._RECT()
# 
#         new_rect.left = self.left - other.left
#         new_rect.right = self.right - other.left
# 
#         new_rect.top = self.top - other.top
#         new_rect.bottom = self.bottom - other.top
# 
#         return new_rect
# 
#     # ----------------------------------------------------------------
#     def __add__(self, other):
#         """Allow two rects to be added using +"""
#         new_rect = self._RECT()
# 
#         new_rect.left = self.left + other.left
#         new_rect.right = self.right + other.left
# 
#         new_rect.top = self.top + other.top
#         new_rect.bottom = self.bottom + other.top
# 
#         return new_rect
# 
#     # ----------------------------------------------------------------
#     def width(self):
#         """Return the width of the rect"""
#         return self.right - self.left
# 
#     # ----------------------------------------------------------------
#     def height(self):
#         """Return the height of the rect"""
#         return self.bottom - self.top
# 
#     # ----------------------------------------------------------------
#     def mid_point(self):
#         """Return a POINT structure representing the mid point"""
#         pt = self._POINT()
#         pt.x = self.left + int(float(self.width()) / 2.)
#         pt.y = self.top + int(float(self.height()) / 2.)
#         return pt
# 
#     __reduce__ = _reduce
# 
# Path: pywinauto/backend.py
# class Singleton(type):
# 
#     """
#     Singleton metaclass implementation from StackOverflow
# 
#     http://stackoverflow.com/q/6760685/3648361
#     """
# 
#     _instances = {}
#     def __call__(cls, *args, **kwargs):
#         if cls not in cls._instances:
#             cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
#         return cls._instances[cls]


# Path: pywinauto/linux/atspi_objects.py
import subprocess
import six
from ctypes import c_int, c_bool, c_char_p, c_char, POINTER, c_uint, c_uint32, c_uint64, c_double, c_short, \
    create_string_buffer, cdll, pointer, c_void_p, CFUNCTYPE
from functools import wraps
from ..base_types import Structure
from ..base_types import PointIteratorMixin
from ..base_types import RectExtMixin
from ..backend import Singleton

    _fields_ = [
        ('g_type_instance', _GTypeInstance),
        ('ref_count', c_uint),
        ('qdata', POINTER(_GData)),
    ]


class _GError(Structure):
    _fields_ = [
        ('domain', c_uint32),
        ('code', c_int),
        ('message', c_char_p),
    ]


class _GArray(Structure):
    _fields_ = [
        ('data', POINTER(c_char)),
        ('len', c_uint32),
    ]


class _GHashTable(Structure):
    pass


class _GPtrArray(Structure):
    pass



class _GTypeInterface(Structure):