1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 # distutils: language = c++
7 from libc.stdint cimport int64_t, intptr_t, uint32_t, uint64_t
10 cdef extern from "mojo/public/c/system/core.h" nogil:
11 ctypedef uint32_t MojoHandle
12 ctypedef uint64_t MojoDeadline
13 ctypedef uint32_t MojoHandleSignals
16 cdef extern from "mojo/public/cpp/bindings/callback.h" nogil:
17 cdef cppclass CClosure "mojo::Callback<void()>":
21 cdef extern from "mojo/public/c/environment/async_waiter.h" nogil:
22 ctypedef intptr_t MojoAsyncWaitID
25 cdef extern from "mojo/public/python/src/python_system_helper.h" \
26 namespace "mojo::python" nogil:
27 cdef CClosure BuildClosure(object)
28 cdef cppclass PythonAsyncWaiter "mojo::python::PythonAsyncWaiter":
30 MojoAsyncWaitID AsyncWait(MojoHandle,
34 void CancelWait(MojoAsyncWaitID)
37 cdef extern from "mojo/public/cpp/utility/run_loop.h" nogil:
38 cdef cppclass CRunLoop "mojo::RunLoop":
41 void RunUntilIdle() except *
43 void PostDelayedTask(CClosure&, int64_t)
44 cdef CRunLoop CRunLoopCurrent "mojo::RunLoop::current"()
47 cdef extern from "mojo/public/cpp/environment/environment.h" nogil:
48 cdef cppclass CEnvironment "mojo::Environment":