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.
4
5# distutils: language = c++
6
7from libc.stdint cimport int64_t, intptr_t, uint32_t, uint64_t
8
9
10cdef extern from "mojo/public/c/system/core.h" nogil:
11  ctypedef uint32_t MojoHandle
12  ctypedef uint64_t MojoDeadline
13  ctypedef uint32_t MojoHandleSignals
14
15
16cdef extern from "mojo/public/cpp/bindings/callback.h" nogil:
17  cdef cppclass CClosure "mojo::Callback<void()>":
18    CClosure()
19
20
21cdef extern from "mojo/public/c/environment/async_waiter.h"  nogil:
22  ctypedef intptr_t MojoAsyncWaitID
23
24
25cdef 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":
29    PythonAsyncWaiter()
30    MojoAsyncWaitID AsyncWait(MojoHandle,
31                              MojoHandleSignals,
32                              MojoDeadline,
33                              object)
34    void CancelWait(MojoAsyncWaitID)
35
36
37cdef extern from "mojo/public/cpp/utility/run_loop.h" nogil:
38  cdef cppclass CRunLoop "mojo::RunLoop":
39    CRunLoop()
40    void Run() except *
41    void RunUntilIdle() except *
42    void Quit()
43    void PostDelayedTask(CClosure&, int64_t)
44
45
46cdef extern from "mojo/public/cpp/environment/environment.h" nogil:
47  cdef cppclass CEnvironment "mojo::Environment":
48    CEnvironment()
49