1// Copyright (c) 2013 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#include "ppapi/c/pp_instance.h"
6#include "ppapi/c/pp_module.h"
7
8#include "ppapi_simple/ps_event.h"
9#include "ppapi_simple/ps_instance.h"
10#include "ppapi_simple/ps_main.h"
11
12
13void PSEventPost(PSEventType type) {
14  PSInstance::GetInstance()->PostEvent(type);
15}
16
17void PSEventPostBool(PSEventType type, PP_Bool state) {
18  PSInstance::GetInstance()->PostEvent(type, state);
19}
20
21void PSEventPostVar(PSEventType type, struct PP_Var var) {
22  PSInstance::GetInstance()->PostEvent(type, var);
23}
24
25void PSEventPostResource(PSEventType type, PP_Resource resource) {
26  PSInstance::GetInstance()->PostEvent(type, resource);
27}
28
29PSEvent* PSEventTryAcquire() {
30  return PSInstance::GetInstance()->TryAcquireEvent();
31}
32
33PSEvent* PSEventWaitAcquire() {
34  return PSInstance::GetInstance()->WaitAcquireEvent();
35}
36
37void PSEventRelease(PSEvent* event) {
38  PSInstance::GetInstance()->ReleaseEvent(event);
39}
40
41void PSEventSetFilter(PSEventTypeMask filter) {
42  PSInstance::GetInstance()->SetEnabledEvents(filter);
43}
44
45