Hipe : HTML Interface Pipe
How Hipe Works  |  Installation  |  Running hiped  |  Hipe API

The Hipe API
Including libhipe
libhipe functions
C++ extensions
Multithreading considerations
Hipe instructions
Interprocess communication
Tags, attributes and styles
Locations
HIPE_OP_ADD_FONT
HIPE_OP_ADD_STYLE_RULE
HIPE_OP_ADD_STYLE_RULE_SRC
HIPE_OP_APPEND_TAG
HIPE_OP_APPEND_TEXT
HIPE_OP_ATTRIBUTE_RETURN
HIPE_OP_AUDIOVIDEO_STATE
HIPE_OP_CANVAS_ACTION
HIPE_OP_CANVAS_QUERY
HIPE_OP_CANVAS_QUERY_RETURN
HIPE_OP_CANVAS_SET_PROPERTY
HIPE_OP_CARAT_POSITION
HIPE_OP_CLEAR
HIPE_OP_CONTAINER_GRANT
HIPE_OP_CONTENT_RETURN
HIPE_OP_DELETE
HIPE_OP_DIALOG
HIPE_OP_DIALOG_INPUT
HIPE_OP_DIALOG_RETURN
HIPE_OP_EDIT_ACTION
HIPE_OP_EDIT_CONTEXT_REQUEST
HIPE_OP_EDIT_STATUS
HIPE_OP_EVENT
HIPE_OP_EVENT_CANCEL
HIPE_OP_EVENT_REQUEST
HIPE_OP_FIFO_ADD_ABILITY
HIPE_OP_FIFO_CLOSE
HIPE_OP_FIFO_DROP_PEER
HIPE_OP_FIFO_GET_PEER
HIPE_OP_FIFO_INFO
HIPE_OP_FIFO_OPEN
HIPE_OP_FIFO_REMOVE_ABILITY
HIPE_OP_FIFO_RESPONSE
HIPE_OP_FILE_RETURN
HIPE_OP_FIND_RESULT
HIPE_OP_FIND_TEXT
HIPE_OP_FRAME_CLOSE
HIPE_OP_FRAME_EVENT
HIPE_OP_FREE_LOCATION
HIPE_OP_GEOMETRY_RETURN
HIPE_OP_GET_ATTRIBUTE
HIPE_OP_GET_AUDIOVIDEO_STATE
HIPE_OP_GET_BY_ID
HIPE_OP_GET_CARAT_POSITION
HIPE_OP_GET_CONTENT
HIPE_OP_GET_FIRST_CHILD
HIPE_OP_GET_FRAME_KEY
HIPE_OP_GET_GEOMETRY
HIPE_OP_GET_LAST_CHILD
HIPE_OP_GET_NEXT_SIBLING
HIPE_OP_GET_PREV_SIBLING
HIPE_OP_GET_RANGE_GEOMETRY
HIPE_OP_GET_SCROLL_GEOMETRY
HIPE_OP_GET_SELECTION
HIPE_OP_GET_STYLE
HIPE_OP_INSERT_TAG
HIPE_OP_GET_X11_XID
HIPE_OP_INSERT_TAG
HIPE_OP_KEY_RETURN
HIPE_OP_LOCATION_RETURN
HIPE_OP_MEASURE_TEXT
HIPE_OP_MESSAGE
HIPE_OP_OPEN_LINK
HIPE_OP_RANGE_GEOMETRY
HIPE_OP_REMOVE_ATTRIBUTE
HIPE_OP_REQUEST_CONTAINER
HIPE_OP_SCROLL_BY
HIPE_OP_SCROLL_TO
HIPE_OP_SERVER_DENIED
HIPE_OP_SERVER_NOTICE
HIPE_OP_SET_ATTRIBUTE
HIPE_OP_SET_CURSOR
HIPE_OP_SET_FOCUS
HIPE_OP_SET_ICON
HIPE_OP_SET_SRC
HIPE_OP_SET_STYLE
HIPE_OP_SET_STYLE_SRC
HIPE_OP_SET_TEXT
HIPE_OP_SET_TITLE
HIPE_OP_SRC_RETURN
HIPE_OP_STYLE_RETURN
HIPE_OP_TAKE_SNAPSHOT
HIPE_OP_TEXT_METRICS
HIPE_OP_TOGGLE_CLASS
HIPE_OP_USE_CANVAS
HIPE_OP_X11_XID_RETURN

Instruction set reference

HIPE_OP_EVENT_REQUEST

Send this instruction to the server to request notifications of a particular event on a particular element.

Notes

For specifying the type of event, names of events are the same as their HTML/Javascript equivalents, except without the "on" prefix.

For example, to get reports of click events, you would pass "click" in arg[0] (not "onclick"), or for a key pressed down event you would pass "keydown" (not "onkeydown" as in HTML/Javascript).

Each event is reported with HIPE_OP_EVENT, which lists the detail reported for each event type, including which modifier keys (Shift, Alt, Ctrl, Meta) were held.

keyup and keydown events can be requested on a child iframe: they report keys pressed while the keyboard focus is inside the client occupying that frame (or inside any frame nested within it). The events carry the requestor value of your most recent request for that event on that iframe, and each key is reported once: requesting keydown or keyup again on the same iframe replaces the requestor rather than adding another report. The detail includes the modifier mask as for any other keydown or keyup event. The same keys also reach your body element, so if you have requested keydown or keyup on the body as well, you receive both reports. keypress events remain within the iframe and don't propagate out to the parent client.

mousedown and mouseup events can also be requested on a child iframe: they report every press and release of a mouse button anywhere in that frame, including inside frames nested within it. They tell you where the pointer was, not what it was over. The detail is in your own coordinates, as if the event had happened on the iframe element itself:

DetailValue
buttonAs for any mouse event (1 = left).
pageX, pageYThe pointer's position on your page.
offsetX, offsetYThe same, relative to the iframe element.
modifiersThe modifier mask, as for any mouse event.

As with keys, the events carry the requestor of your most recent request for that event on that iframe, and the child client still receives its own mouse events as usual. A frame that has no content yet reports nothing.

Several requests can be active for the same event on the same element. Each request adds a new listener, and all of them stay active, so each event is reported once per request. This happens even if the requests use the same requestor value. For example, if you request the click event on the same button twice, each click on that button is reported twice.

To replace a request, cancel it with HIPE_OP_EVENT_CANCEL before requesting the event again.

Cancelling default actions

arg[1] can cancel an event's default action: what would happen without your app (a key typing text or moving the focus, the wheel scrolling, a right-click opening the edit menu, and so on). The event is cancelled as it happens, before the default action, so the decision is made from rules given in advance. You still receive the event as usual, and can then do something else instead (e.g. indent a line when Tab is pressed).

arg[1] is a list of rules separated by ;. An event is cancelled if it matches any of them. Each rule is code,modifiers, written like the event's detail in HIPE_OP_EVENT:

* matches anything, and ,modifiers can be left out to match any modifiers. So * alone cancels every event. A rule with a specific code or modifier mask never matches an event that doesn't have one: e.g. wheel events have no code (only * matches), and events such as input or scroll have neither. Rules that can't be read are ignored.

Eventarg[1]Cancels
keydown9,0;9,1Tab and Shift+Tab (the focus doesn't move)
keydown83,4Ctrl+S
keydown9Tab with any modifier keys
wheel*,4Ctrl+wheel (plain wheel still scrolls)
mousedown1left-button presses (no focus change or text selection)
contextmenu-nothing: the edit menu still opens

Notes:

Events and locations

An event request belongs to the element, not its location number: each event is reported with the location the element has when it happens. After HIPE_OP_FREE_LOCATION the element's events are no longer reported. See "Locations".