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_EDIT_ACTION

Performs a cut/copy/paste or other edit action on the text the user has selected, or at the text cursor, in the element that has keyboard focus.

Every application inside a top-level window is a frame of the same document hierarchy, so an edit action always applies to the frame that currently has keyboard focus. To stop one application acting on another's content, the rules depend on who sends the instruction:

Action codes

CharacterEditing operation
zUndo
ZRedo
aSelect all
xCut selected text to clipboard
cCopy selected text to clipboard
vPaste selected text from clipboard, matching destination formatting
VPaste selected text from clipboard, preserving source formatting if applicable
bToggles bold if applicable
iToggles italic if applicable
uToggles underline if applicable
kToggles strikethrough if applicable
lAlign left if applicable
CAlign center if applicable
rAlign right if applicable
jAlign justified if applicable
dSet text direction default
>Set text direction left to right
<Set text direction right to left
tInsert the text given in arg[1], or delete the selected text if arg[1] is empty

Notes

This operation will succeed or fail silently. There is no response from the server. Use HIPE_OP_EDIT_STATUS to find out which actions are currently available.

Paste from a non-top-level client. Pasting gives the clipboard's contents to the client that receives them, so a client that isn't top-level may only paste in response to the user: within a few seconds after the user clicked or pressed a key in its frame, or after the framing manager relayed the user's answer to a dialog (HIPE_OP_DIALOG_RETURN) to it or to a frame containing it. In practice, send the paste instruction as soon as you receive the click, key press or dialog answer that asked for it. At other times it is ignored. The user can always paste with the keyboard shortcut, which doesn't use this instruction.

Insert text (t) puts the text in arg[1] at the text cursor, replacing any selected text, as if the user had typed it. Nothing happens unless the text cursor is in editable content (a text input, a <textarea>, or an element with the contenteditable attribute). The text is never treated as HTML: characters such as < and & are shown as typed. Each newline in the text becomes a line break, as when the user presses Enter in plain text (a single-line text input can't hold line breaks, so each newline becomes a space there), and the text cursor is left after the inserted text. The whole insertion is undone by a single undo; as with ordinary typing, that undo also removes anything the user typed immediately before it. A typical use is inserting a tab or indentation when the user presses Tab, after cancelling the key's default action (see HIPE_OP_EVENT_REQUEST).

If arg[1] is empty, t deletes the selected text instead, as the Delete key would, and leaves the text cursor where the selection was. This is one step for undo. If no text is selected (there is only a text cursor), nothing is deleted. To remove a particular range, select it first with HIPE_OP_CARAT_POSITION.

Undo and redo act on the undo history of the focused frame's document. Each frame has its own undo history, so undoing in one application never reverts an edit made in another.