ppapi

package
v0.0.0-...-dab3559 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2013 License: BSD-3-Clause, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	/**
	 * This value is returned by a function on successful synchronous completion
	 * or is passed as a result to a PP_CompletionCallback_Func on successful
	 * asynchronous completion.
	 */
	PP_OK = 0
	/**
	 * This value is returned by a function that accepts a PP_CompletionCallback
	 * and cannot complete synchronously. This code indicates that the given
	 * callback will be asynchronously notified of the final result once it is
	 * available.
	 */
	PP_OK_COMPLETIONPENDING = -1
	/**This value indicates failure for unspecified reasons. */
	PP_ERROR_FAILED = -2
	/**
	 * This value indicates failure due to an asynchronous operation being
	 * interrupted. The most common cause of this error code is destroying a
	 * resource that still has a callback pending. All callbacks are guaranteed
	 * to execute, so any callbacks pending on a destroyed resource will be
	 * issued with PP_ERROR_ABORTED.
	 *
	 * If you get an aborted notification that you aren't expecting, check to
	 * make sure that the resource you're using is still in scope. A common
	 * mistake is to create a resource on the stack, which will destroy the
	 * resource as soon as the function returns.
	 */
	PP_ERROR_ABORTED = -3
	/** This value indicates failure due to an invalid argument. */
	PP_ERROR_BADARGUMENT = -4
	/** This value indicates failure due to an invalid PP_Resource. */
	PP_ERROR_BADRESOURCE = -5
	/** This value indicates failure due to an unavailable PPAPI interface. */
	PP_ERROR_NOINTERFACE = -6
	/** This value indicates failure due to insufficient privileges. */
	PP_ERROR_NOACCESS = -7
	/** This value indicates failure due to insufficient memory. */
	PP_ERROR_NOMEMORY = -8
	/** This value indicates failure due to insufficient storage space. */
	PP_ERROR_NOSPACE = -9
	/** This value indicates failure due to insufficient storage quota. */
	PP_ERROR_NOQUOTA = -10
	/**
	 * This value indicates failure due to an action already being in
	 * progress.
	 */
	PP_ERROR_INPROGRESS = -11
	/** This value indicates failure due to a file that does not exist. */
	/**
	 * The requested command is not supported by the browser.
	 */
	PP_ERROR_NOTSUPPORTED = -12
	/**
	 * Returned if you try to use a null completion callback to "block until
	 * complete" on the main thread. Blocking the main thread is not permitted
	 * to keep the browser responsive (otherwise, you may not be able to handle
	 * input events, and there are reentrancy and deadlock issues).
	 *
	 * The goal is to provide blocking calls from background threads, but PPAPI
	 * calls on background threads are not currently supported. Until this
	 * support is complete, you must either do asynchronous operations on the
	 * main thread, or provide an adaptor for a blocking background thread to
	 * execute the operaitions on the main thread.
	 */
	PP_ERROR_BLOCKS_MAIN_THREAD = -13
	PP_ERROR_FILENOTFOUND       = -20
	/** This value indicates failure due to a file that already exists. */
	PP_ERROR_FILEEXISTS = -21
	/** This value indicates failure due to a file that is too big. */
	PP_ERROR_FILETOOBIG = -22
	/**
	 * This value indicates failure due to a file having been modified
	 * unexpectedly.
	 */
	PP_ERROR_FILECHANGED = -23
	/** This value indicates failure due to a time limit being exceeded. */
	PP_ERROR_TIMEDOUT = -30
	/**
	 * This value indicates that the user cancelled rather than providing
	 * expected input.
	 */
	PP_ERROR_USERCANCEL = -40
	/**
	 * This value indicates failure due to lack of a user gesture such as a
	 * mouse click or key input event. Examples of actions requiring a user
	 * gesture are showing the file chooser dialog and going into fullscreen
	 * mode.
	 */
	PP_ERROR_NO_USER_GESTURE = -41
	/**
	 * This value indicates that the graphics context was lost due to a
	 * power management event.
	 */
	PP_ERROR_CONTEXT_LOST = -50
	/**
	 * Indicates an attempt to make a PPAPI call on a thread without previously
	 * registering a message loop via PPB_MessageLoop.AttachToCurrentThread.
	 * Without this registration step, no PPAPI calls are supported.
	 */
	PP_ERROR_NO_MESSAGE_LOOP = -51
	/**
	 * Indicates that the requested operation is not permitted on the current
	 * thread.
	 */
	PP_ERROR_WRONG_THREAD = -52
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core interface {
	AddRefResource(Resource)
	ReleaseResource(Resource)
	GetTime() time.Time
	//GetTimeTicks()
	//CallOnMainThread(after time.Duration, ...)
	IsMainThread() bool
}

type FloatPoint

type FloatPoint struct {
	// contains filtered or unexported fields
}

type Instance

type Instance interface {
	DidCreate(args map[string]string) error
	DidChangeView(View)
	DidChangeFocus(hasFocus bool)
}

type InstanceCreator

type InstanceCreator interface {
	// CreateInstance is invoked to instantiate the
	// module, for each <embed> tag in the web page.
	CreateInstance(PP_Instance) (Instance, error)
}

InstanceCreator is an interface used for creating module instances. An InstanceCreator must be passed to NewModule from the "main.CreateModule" function.

type Module

type Module struct {
	// Core is an instance of the core interface for
	// doing basic global operations. This field is
	// guarantee to be non-nil during/after invocation
	// of init.
	Core
	// contains filtered or unexported fields
}

Module represents a plugin module.

Developers must implement a function with the signature "func CreateModule() (*Module, error)", in the main package.

func NewModule

func NewModule(c InstanceCreator) (*Module, error)

NewModule creates a new Module, initialising it with an InstanceCreator, which must be non-nil. The value passed in may optionally implement ModuleInitialiser, whose InitModule method will be invoked if implemented.

func (*Module) BrowserInterface

func (m *Module) BrowserInterface(name string) interface{}

func (*Module) PluginInterface

func (m *Module) PluginInterface(name string) interface{}

func (*Module) PostMessage

func (m *Module) PostMessage(instance PP_Instance, value interface{}) error

type ModuleInitialiser

type ModuleInitialiser interface {
	// InitModule is invoked to initialise a module.
	//
	// If the module requires any global initialisation
	// that involves calling into PPAPI, then it must
	// be done during or after the call to InitModule.
	InitModule() error
}

ModuleInitialiser is an interface that may optionally be implemented by the value passed to NewModule.

type PP_Instance

type PP_Instance int32

type Point

type Point struct {
	// contains filtered or unexported fields
}

type Rect

type Rect struct {
	// Point is the the top-left corner of the rectangle.
	Point

	// Size represents the width and height of the rectangle.
	Size
}

type Resource

type Resource int32

type Size

type Size struct {
	// contains filtered or unexported fields
}

type Var

type Var struct {
	Type VarType

	Value VarValue
	// contains filtered or unexported fields
}

func MakeVar

func MakeVar(value interface{}) (Var, error)

func MakeVarInt32

func MakeVarInt32(value int32) Var

func MakeVarString

func MakeVarString(s string) Var

type VarType

type VarType int32
const (
	VarTypeUndefined VarType = 0
	VarTypeNull      VarType = 1
	VarTypeBool      VarType = 2
	VarTypeInt32     VarType = 3
)

type VarValue

type VarValue float64

type View

type View Resource

func (View) Rect

func (v View) Rect() Rect

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL