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 PSEventPost(PSEventType type)13void PSEventPost(PSEventType type) { 14 PSInstance::GetInstance()->PostEvent(type); 15 } 16 PSEventPostBool(PSEventType type,PP_Bool state)17void PSEventPostBool(PSEventType type, PP_Bool state) { 18 PSInstance::GetInstance()->PostEvent(type, state); 19 } 20 PSEventPostVar(PSEventType type,struct PP_Var var)21void PSEventPostVar(PSEventType type, struct PP_Var var) { 22 PSInstance::GetInstance()->PostEvent(type, var); 23 } 24 PSEventPostResource(PSEventType type,PP_Resource resource)25void PSEventPostResource(PSEventType type, PP_Resource resource) { 26 PSInstance::GetInstance()->PostEvent(type, resource); 27 } 28 PSEventTryAcquire()29PSEvent* PSEventTryAcquire() { 30 return PSInstance::GetInstance()->TryAcquireEvent(); 31 } 32 PSEventWaitAcquire()33PSEvent* PSEventWaitAcquire() { 34 return PSInstance::GetInstance()->WaitAcquireEvent(); 35 } 36 PSEventRelease(PSEvent * event)37void PSEventRelease(PSEvent* event) { 38 PSInstance::GetInstance()->ReleaseEvent(event); 39 } 40 PSEventSetFilter(PSEventTypeMask filter)41void PSEventSetFilter(PSEventTypeMask filter) { 42 PSInstance::GetInstance()->SetEnabledEvents(filter); 43 } 44 45