Code Monkey home page Code Monkey logo

layouts-service's Introduction

OpenFin Layouts

Overview

OpenFin Layouts delivers window management and layout user experience across the desktop for OpenFin-based applications.

OpenFin Layouts uses the new Services framework to expose its API to consuming applications. You can see the documentation for these APIs here: http://cdn.openfin.co/jsdocs/alpha/fin.desktop.Service.html.

This project consist of 3 parts:

  1. The Layouts Service, which manages the state of windows, tabs and layouts
  2. The Layouts Client, which exposes calls to programatically control snap/dock, tabbing and save/restore.
  3. Layout Service Demo app, demonstrating the different features of OpenFin Layout

Dependencies

  • OpenFin version for applications using Layouts = 9.61.33.32
  • OpenFin version used in the Layouts Service = 9.61.33.32
  • RVM >= 4.4.1.1

Features

  • Snap & Dock
    • Windows snap to all sides of other window or group of windows
    • Windows of comparable size will snap and stretch to match the target window
    • Visible feedback on where the dragged window will be snapped/stretched to target window/group
    • Resize windows in group
    • On inclusion of the client API, undocking can be done with CTRL+SHIFT+U or CMD+SHIFT+U. (Global hotkey support ETA September '18)
  • Tabbing
    • Dropping a window ontop of another window will create tabbed windows with a tabstrip on top
    • Tabs can be reorder and renamed.
    • Minimize / maximize / restore / close on the tabstrip affects the whole tabgroup (tabstrip and tabbed windows)
    • Application developers can provide their own tabstrip - simply by hosting a templated html, initiated on application startup
    • The service comes with a win10 like default tabstrip that will used if no custom tabstrip is defined
  • Save and restore
    • The service has APIs for getting and restoring layouts
    • The provided demo showcases how a layout manager application could use the APIs to manage layouts
  • APIs
    • API available to undock, ungroup, tab / untab , save / restore a layout or opt-out of tabbing and snapping.
  • Hosting
    • The lastest production version OpenFin Layouts will by default be served from OpenFin's CDN
    • For testing / dev purposes, a customers can specify an absolute version/location of a the service by providing the full URL in the services section of the app manifest (se Manifest declaration below)

Run Locally

  • Windows support only.
  • Node 8.11 LTS.
  • Testing requires robotjs and you may need to build it. See their docs for info on building if you are testing. npm install--ignore-scripts is fine if you are not running the tests.
npm install --ignore-scripts
npm run dev

Getting Started

Using the Layouts service is done in two steps, add the service to application manifest and import the API:

Manifest declaration

To ensure the service is running, you must declare it in your application config.

"services" :
[
   {
   "name":"layouts"
   }
]

Optionally you can add a URL for specifying a custom location or a specific version:

"services" :
[
   {
   "name":"layouts",
   "manifestUrl": "https://custom-location/0.9/app.json"
   }
]

Import the Client API

npm install openfin-layouts

The client module exports a set of functions - API doc available at [tsdoc link to be inserted]

Usage

Using Layouts is described in detail in our tutorial - available at [tutorial link goes here]

Testing

npm install
npm test

Notes

  • If using Parallels Desktop, you have to be in a mode where Parallels can control the mouse. Set Settings>Hardware>Mouse&Keyboard>Mouse to Optimize for Games

Known Issues

  • Apps in a layout need to be in the same runtime
  • Aero Shake (win7) and Windows Snap Assist(win10) are not supported
  • Window can be misalignment on Windows 10, scheduled to be fixed in OpenFin Runtime .35
  • "deregister" opts out of snap/dock & tabbing, but currently not save/restore
  • Tabbed windows currently cannot be snapped
  • Changing monitor and/or screen resolution is currently not supported
  • Minimizing one window in a snap group only minimizes the window not the group

License

This project uses the Apache2 license

Support

This is an open source project and all are encouraged to contribute. Please enter an issue in the repo for any questions or problems. For further inqueries, please contact us at [email protected]

layouts-service's People

Contributors

pbaize avatar tomrobertsof avatar pjbroadbent avatar michaelmcoates avatar tgoc99 avatar bschwinn avatar datamadic avatar johnathonlamof avatar aziz512 avatar espenove avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.