How to use the westfield-runtime-common.Connection function in westfield-runtime-common

To help you get started, we’ve selected a few westfield-runtime-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github udevbe / westfield / client / runtime / src / index.js View on Github external
import GrWebShmProxy from './protocol/GrWebShmProxy'
import GrWebShmBufferEvents from './protocol/GrWebShmBufferEvents'

// web gl
import GrWebGlBufferProxy from './protocol/GrWebGlBufferProxy'
import GrWebGlProxy from './protocol/GrWebGlProxy'
import GrWebGlBufferEvents from './protocol/GrWebGlBufferEvents'

/**
 * @type {WebFS}
 */
const webFS = WebFS.create(_uuidv4())
/**
 * @type {Connection}
 */
const connection = new Connection()
/**
 * @type {Display}
 */
const display = new Display(connection)

/**
 * @returns {string}
 * @private
 */
function _uuidv4 () {
  return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
    (c ^ self.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
  )
}

/**
github udevbe / westfield / server / web / runtime / src / Client.js View on Github external
constructor (display, id) {
    super()
    /**
     * @type {string}
     */
    this.id = id
    /**
     * @type {Connection}
     */
    this.connection = new Connection()
    /**
     * @type {Display}
     * @private
     */
    this._display = display
    /**
     * @type {number}
     * @private
     */
    this._syncEventSerial = 0
    /**
     * @type {function():void}
     * @private
     */
    this._destroyedResolver = null
    /**
github udevbe / westfield / client / runtime / src / Display.js View on Github external
constructor () {
    super()
    /**
     * @type {number}
     */
    this.nextId = 1
    /**
     * @type {Connection}
     */
    this.connection = new Connection()
    /**
     * @type {WlDisplayProxy}
     */
    this.displayProxy = new WlDisplayProxy(this, this.nextId++)
    /**
     * @type {Display}
     */
    this.displayProxy.listener = this
  }

westfield-runtime-common

Wayland HTML5 common client-server runtime

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis