orientation

package
v0.0.0-...-41cedfc Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: BSD-3-Clause Imports: 4 Imported by: 2

Documentation

Overview

Package orientation provides the ability to read the screen orientation type and angle, to be informed when the screen orientation changes, and to lock the screen to a specific orientation.

Browser support on https://caniuse.com/#feat=screen-orientation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrientationLockType

type OrientationLockType int

enum: OrientationLockType

const (
	AnyOrientationLockType OrientationLockType = iota
	NaturalOrientationLockType
	LandscapeOrientationLockType
	PortraitOrientationLockType
	PortraitPrimaryOrientationLockType
	PortraitSecondaryOrientationLockType
	LandscapePrimaryOrientationLockType
	LandscapeSecondaryOrientationLockType
)

func OrientationLockTypeFromJS

func OrientationLockTypeFromJS(value js.Value) OrientationLockType

OrientationLockTypeFromJS is converting a javascript value into a OrientationLockType enum value.

func (*OrientationLockType) JSValue

func (this *OrientationLockType) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (OrientationLockType) Value

func (this OrientationLockType) Value() string

Value is converting this into javascript defined string value

type OrientationType

type OrientationType int

enum: OrientationType

const (
	PortraitPrimaryOrientationType OrientationType = iota
	PortraitSecondaryOrientationType
	LandscapePrimaryOrientationType
	LandscapeSecondaryOrientationType
)

func OrientationTypeFromJS

func OrientationTypeFromJS(value js.Value) OrientationType

OrientationTypeFromJS is converting a javascript value into a OrientationType enum value.

func (*OrientationType) JSValue

func (this *OrientationType) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (OrientationType) Value

func (this OrientationType) Value() string

Value is converting this into javascript defined string value

type ScreenOrientation

type ScreenOrientation struct {
	domcore.EventTarget
}

class: ScreenOrientation

func ScreenOrientationFromJS

func ScreenOrientationFromJS(value js.Value) *ScreenOrientation

ScreenOrientationFromJS is casting a js.Value into ScreenOrientation.

func ScreenOrientationFromWrapper

func ScreenOrientationFromWrapper(input core.Wrapper) *ScreenOrientation

ScreenOrientationFromJS is casting from something that holds a js.Value into ScreenOrientation.

func (*ScreenOrientation) AddEventChange

func (_this *ScreenOrientation) AddEventChange(listener func(event *domcore.Event, currentTarget *ScreenOrientation)) js.Func

AddChange is adding doing AddEventListener for 'Change' on target. This method is returning allocated javascript function that need to be released.

func (*ScreenOrientation) Angle

func (_this *ScreenOrientation) Angle() int

Angle returning attribute 'angle' with type int (idl: unsigned short).

func (*ScreenOrientation) Lock

func (_this *ScreenOrientation) Lock(orientation OrientationLockType) (_result *javascript.PromiseVoid)

func (*ScreenOrientation) OnChange

func (_this *ScreenOrientation) OnChange() domcore.EventHandlerFunc

OnChange returning attribute 'onchange' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*ScreenOrientation) SetOnChange

func (_this *ScreenOrientation) SetOnChange(listener func(event *domcore.Event, currentTarget *ScreenOrientation)) js.Func

SetOnChange is assigning a function to 'onchange'. This This method is returning allocated javascript function that need to be released.

func (*ScreenOrientation) Type

func (_this *ScreenOrientation) Type() OrientationType

Type returning attribute 'type' with type OrientationType (idl: OrientationType).

func (*ScreenOrientation) Unlock

func (_this *ScreenOrientation) Unlock()

type Union

type Union struct {
	Value js.Value
}

func UnionFromJS

func UnionFromJS(value js.Value) *Union

func (*Union) JSValue

func (u *Union) JSValue() js.Value

Jump to

Keyboard shortcuts

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