Page MenuHomePhabricator

Teamwork Api
Updated 934 Days AgoPublic

Overview

Teamwork is a protocol for application integration with the Enlightenment (E18+) compositor. It was created to allow applications to:

  • Leave popup creation and rendering to the compositor
  • Simplify and reduce application code
  • Provide an easy method to create a richer desktop experience across all EFL applications

While Teamwork is implemented as an E18+ module, its interfaces can be utilized by any toolkit or application.

Integrating in an EFL application

Use elm_win_teamwork_uri_preload() if your application detects a uri (local or remote) that it might want to display as a tooltip. The compositor will then preload the passed uri for faster loading.

Use elm_win_teamwork_uri_show() if your application determines that a uri should be displayed. Mouse coordinates are automatically passed using the current pointer location on the canvas.

Use elm_win_teamwork_uri_hide() if your application determines that a previously-displayed uri should be hidden. It's good policy to explicitly hide whenever the mouse leaves the window.

Use elm_win_teamwork_uri_open() if your application wants to open a uri. The compositor will automatically use the corresponding mime-type to open the uri.

Teamwork v1

DBus connection info (v1.1)

Bus: org.enlightenment.wm.service
Object: /org/enlightenment/wm/RemoteObject
Interface: org.enlightenment.wm.Teamwork

DBus methods

All methods have no return value, and timestamps should be unixtime.

LinkDetect : String:URI, Uint:Timestamp :
Call when a link is detected in an application to allow remote data to be fetched and preloaded.

LinkMouseIn : String:URI, Uint:Timestamp, Uint64:Client ID, Int:X client coordinate, Int: Y client coordinate :
Call when an application detects that the mouse has entered a link; coordinates should be client-relative. Client ID in X is the XWindow, in Wayland it should be (client_surface_id << 32) + getpid()

LinkMouseOut : String:URI, Uint:Timestamp, Uint64:Client ID, Int:X client coordinate, Int: Y client coordinate :
Call when an application detects that the mouse has exited a link; coordinates should be client-relative. Client ID in X is the XWindow, in Wayland it should be (client_surface_id << 32) + getpid()

LinkShow : String:URI, Uint:Timestamp :
Call to request the immediate display of the URI.

LinkHide : String:URI, Uint:Timestamp :
Call to request the immediate hide of a URI.

LinkOpen : String:URI :
Call to request that the URI be opened.

DBus signals

Note that all timestamps will be unixtime.

LinkDownloading : String:URI, Uint:Timestamp :
A URI is currently being fetched.

LinkProgress : String:URI, Uint:Timestamp, Double:Percent :
The URI is currently at Percent of completing its download.

LinkComplete : String:URI, Uint:Timestamp :
A URI has completed its fetch and is available for display.

LinkInvalid : String:URI, Uint:Timestamp :
A URI has been determined to be invalid and will never be displayed.

Teamwork v2

X11 Interface

Properties:
_TEAMWORK_PROP - The client will store the "active" uri in this property on its window

Messages:
_TEAMWORK_PRELOAD - A client can request preloading of a uri in advance of requesting that it be displayed
Format: 32
Values:

  • Version - The version of Teamwork protocol being used

_TEAMWORK_ACTIVATE - A client can request display of a uri at given coordinates
Format: 32
Values:

  • Version - The version of Teamwork protocol being used
  • x - The window-relative x coordinate of the mouse
  • y - The window-relative y coordinate of the mouse

_TEAMWORK_DEACTIVATE - A client can request hiding a previously shown uri
Format: 32
Values:

  • Version - The version of Teamwork protocol being used

_TEAMWORK_OPEN - A client can request that the compositor open a uri using its mime-type handlers
Format: 32
Values:

  • Version - The version of Teamwork protocol being used

_TEAMWORK_COMPLETED - The server can send a notification to the client window to indicate completion of a download
Format: 32
Values:

  • Version - The version of Teamwork protocol being used
  • Success - True if a uri can be displayed by the compositor

_TEAMWORK_PROGRESS - The server can send a notification to the client window to indicate progress of a download
Format: 32
Values:

  • Version - The version of Teamwork protocol being used
  • Percentage - The percentage of media download, rounded to nearest integer

_TEAMWORK_STARTED - The server can send a notification to the client window to indicate commencement of a download
Format: 32
Values:

  • Version - The version of Teamwork protocol being used

Wayland Interface

<protocol name="teamwork">

  <interface name="zwp_teamwork" version="2">
    <request name="preload_uri">
      <arg name="surface" type="object" interface="wl_surface"/>
      <arg name="uri" type="string"/>
    </request>
    <request name="activate_uri">
      <arg name="surface" type="object" interface="wl_surface"/>
      <arg name="uri" type="string"/>
      <arg name="x" type="fixed" summary="surface local coords"/>
      <arg name="y" type="fixed" summary="surface local coords"/>
    </request>
    <request name="deactivate_uri">
      <arg name="surface" type="object" interface="wl_surface"/>
      <arg name="uri" type="string"/>
    </request>
    <request name="open_uri">
      <arg name="surface" type="object" interface="wl_surface"/>
      <arg name="uri" type="string"/>
    </request>

    <event name="fetching_uri">
      <arg name="surface" type="object" interface="wl_surface"/>
      <arg name="uri" type="string"/>
    </event>
    <event name="completed_uri">
      <arg name="surface" type="object" interface="wl_surface"/>
      <arg name="uri" type="string"/>
      <arg name="valid" type="int" summary="1 if uri can be displayed, else 0"/>
    </event>
    <event name="fetch_info">
      <arg name="surface" type="object" interface="wl_surface"/>
      <arg name="uri" type="string"/>
      <arg name="progress" type="uint" summary="percentage of download"/>
    </event>
  </interface>

</protocol>

Protocol History

E18 (1.0)

LinkMouseIn : String:URI, Uint:Timestamp, Int64:Client ID, Int:X client coordinate, Int: Y client coordinate :
Call when an application detects that the mouse has entered a link; coordinates should be client-relative. Client ID in X is the XWindow, in Wayland it should be client_surface_id

LinkMouseOut : String:URI, Uint:Timestamp, Int64:Client ID, Int:X client coordinate, Int: Y client coordinate :
Call when an application detects that the mouse has exited a link; coordinates should be client-relative. Client ID in X is the XWindow, in Wayland it should be client_surface_id

E21 (2.0)

Switch to display protocol interfaces, simplify protocol

Teamwork-enabled applications

  • Shotgun
  • Terminology
Last Author
zmike
Last Edited
May 20 2016, 12:34 PM
Projects
None
Subscribers
None