# Path: src/pegl/ext/khr_sync.py
# NO_SYNC = c_void_p(0)
# FOREVER = 0xFFFFFFFFFFFFFFFF
#     SYNC_STATUS = 0x30F1
#     SYNC_TYPE = 0x30F7
#     SYNC_CONDITION = 0x30F8
#         TIMEOUT_EXPIRED, CONDITION_SATISFIED = 0x30F5, 0x30F6
# class WaitFlags(BitMask):
# class SyncAttribs(Attribs):
# class Sync:
# class ReusableSync(Sync):
# class FenceSync(Sync):
#     def __init__(self, display, attribs):
#     def _create_handle(self):
#     def __del__(self):
#     def _as_parameter_(self):
#     def _attr(self, attr):
#     def status(self):
#     def sync_type(self):
#     def signaled(self):
#     def client_wait(self, timeout_ns=FOREVER, flush_commands=False):
#     def __init__(self, display):
#     def signal(self, signaled=True):
#     def __init__(self, display):
#     def sync_condition(self):
# 
# Path: src/pegl/native.py
# def make_int_p(ival=0):
# def error_check(fn, fail_on=None, always_check=False, fallback_error=EGLError,
#                 fallback_msg=None, fail_on_null=False):
#     def wrapped_fn(*args, **kwargs):


from ctypes import c_int
from .khr_sync import c_sync, Sync, SyncAttribs
from ..native import c_display
#
# Pegl 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 3 of the License, or
# (at your option) any later version.
#
# Pegl 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 Pegl. If not, see <http://www.gnu.org/licenses/>.

# Standard library imports.

# Local imports.

# New symbolic constants.
NATIVE_FENCE = 0x3144
NATIVE_FENCE_SIGNALED = 0x3146
NO_NATIVE_FENCE_FD = -1
# TODO: Use a custom, extensible alternative to the namedtuple class, so that
# NATIVE_FENCE can be added to khr_sync.SyncTypes, and NATIVE_FENCE_SIGNALED
# to khr_sync.SyncConditions. Of course, I'm really only using those namedtuple
# instances as enumerations, and there's now a proper one of those in the
# standard library as of Python 3.3...

# Get handles of extension functions.
native_dupnativefence = load_ext(b'eglDupNativeFenceFDANDROID', c_int,

# Path: src/pegl/ext/khr_sync.py
# NO_SYNC = c_void_p(0)
# FOREVER = 0xFFFFFFFFFFFFFFFF
#     SYNC_STATUS = 0x30F1
#     SYNC_TYPE = 0x30F7
#     SYNC_CONDITION = 0x30F8
#         TIMEOUT_EXPIRED, CONDITION_SATISFIED = 0x30F5, 0x30F6
# class WaitFlags(BitMask):
# class SyncAttribs(Attribs):
# class Sync:
# class ReusableSync(Sync):
# class FenceSync(Sync):
#     def __init__(self, display, attribs):
#     def _create_handle(self):
#     def __del__(self):
#     def _as_parameter_(self):
#     def _attr(self, attr):
#     def status(self):
#     def sync_type(self):
#     def signaled(self):
#     def client_wait(self, timeout_ns=FOREVER, flush_commands=False):
#     def __init__(self, display):
#     def signal(self, signaled=True):
#     def __init__(self, display):
#     def sync_condition(self):
# 
# Path: src/pegl/native.py
# def make_int_p(ival=0):
# def error_check(fn, fail_on=None, always_check=False, fallback_error=EGLError,
#                 fallback_msg=None, fail_on_null=False):
#     def wrapped_fn(*args, **kwargs):


# Path: src/pegl/ext/android_nativesync.py
from ctypes import c_int
from .khr_sync import c_sync, Sync, SyncAttribs
from ..native import c_display

#
# Pegl 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 3 of the License, or
# (at your option) any later version.
#
# Pegl 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 Pegl. If not, see <http://www.gnu.org/licenses/>.

# Standard library imports.

# Local imports.

# New symbolic constants.
NATIVE_FENCE = 0x3144
NATIVE_FENCE_SIGNALED = 0x3146
NO_NATIVE_FENCE_FD = -1
# TODO: Use a custom, extensible alternative to the namedtuple class, so that
# NATIVE_FENCE can be added to khr_sync.SyncTypes, and NATIVE_FENCE_SIGNALED
# to khr_sync.SyncConditions. Of course, I'm really only using those namedtuple
# instances as enumerations, and there's now a proper one of those in the
# standard library as of Python 3.3...

# Get handles of extension functions.
native_dupnativefence = load_ext(b'eglDupNativeFenceFDANDROID', c_int,

                             (c_display, c_sync), fail_on=NO_NATIVE_FENCE_FD)