Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ TransCoord(3X) — DeltaWindows 1.3.3 Release 4 Version 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

NAME

XTranslateCoordinates — change the coordinate system from one window to another. 

SYNOPSIS

Bool XTranslateCoordinates(display, src_w, dest_w, src_x,

src_y, dest_x_return, dest_y_return, child_return) Display ∗display;  Window src_w, dest_w;  int src_x, src_y;  int ∗dest_x_return, ∗dest_y_return;  Window ∗child_return;

ARGUMENTS

displaySpecifies a connection to an X server; returned from XOpenDisplay(). 

src_wSpecifies the ID of the source window. 

dest_wSpecifies the ID of the frame of reference window. 

src_x

src_ySpecify the x and y coordinates within the source window. 

dest_x_return

dest_y_return
Return the translated x and y coordinates within the frame of reference window.

childIf the point is contained in a mapped child of the destination window, then that child ID is returned in child. 

RETURNS

True if the two windows are on the same screen, else False. 

DESCRIPTION

XTranslateCoordinates() translates coordinates from the frame of reference of one window to another. 

XTranslateCoordinates() returns False and ∗dest_x_return and ∗dest_y_return are set to zero if src_w and dest_w are on different screens.  In addition, if the coordinates are contained in a mapped child of dest_w, then that child is returned in the child_return argument.  When src_w and frame_y are on the same screen, XTranslateCoordinates() returns True, sets ∗dest_x_return and ∗dest_y_return to the location of the point relative to dest_w, and sets child_return to None. 

This function should be avoided in most applications since it requires a roundtrip request to the server.  Most applications benefit from the window-based coordinate system anyway and don’t need global coordinates.  Window managers often need to perform a coordinate transformation from the coordinate space of one window to another, or unambiguously determine which subwindow a coordinate lies in.  XTranslateCoordinates() fulfills this need, while avoiding any race conditions by asking the server to perform this operation. 

ERRORS

BadWindow

SEE ALSO

XGeometry, XParseGeometry(). 

Xlib Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026