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 uintptr_t
9 from mojo import system
11 cdef extern from "third_party/cython/python_export.h":
14 cdef extern from "base/memory/scoped_ptr.h":
15 cdef cppclass scoped_ptr[T]:
18 cdef extern from "mojo/embedder/platform_support.h" \
19 namespace "mojo::embedder" nogil:
20 cdef cppclass PlatformSupport:
23 cdef extern from "mojo/embedder/simple_platform_support.h" \
24 namespace "mojo::embedder" nogil:
25 cdef cppclass SimplePlatformSupport(PlatformSupport):
26 SimplePlatformSupport()
28 cdef extern from "mojo/embedder/embedder.h" nogil:
29 cdef void InitCEmbedder "mojo::embedder::Init"(
30 scoped_ptr[PlatformSupport] platform_support)
32 cdef extern from "mojo/public/platform/native/system_thunks.h" nogil:
33 cdef struct MojoSystemThunks:
35 cdef MojoSystemThunks MojoMakeSystemThunks()
38 InitCEmbedder(scoped_ptr[PlatformSupport](
39 new SimplePlatformSupport()))
40 cdef MojoSystemThunks thunks = MojoMakeSystemThunks()
41 system.SetSystemThunks(<uintptr_t>(&thunks))