X11workbench Toolkit
1.0
|
Macros | |
#define | WBPointInRect(X, Y, R) ((X) >= (R).left && (X) < (R).right && (Y) >= (R).top && (Y) < (R).bottom) |
Returns logical TRUE if the point (X,Y) is within the borders of the rectangle 'R'. More... | |
#define | WBPointInGeom(X, Y, G) ((X) >= (G).x && (X) < ((G).x + (G).width) && (Y) >= (G).y && (Y) < ((G).y + (G).height)) |
Returns logical TRUE if the point (X,Y) is within the borders of the geometry 'G'. More... | |
#define | WBRectOverlapped(R1, R2) |
Returns logical TRUE if the rectangle R1 overlaps/intersects R2. More... | |
#define | WBGeomOverlapped(G1, G2) |
Returns logical TRUE if the geometry G1 overlaps/intersects G2. More... | |
Functions | |
void | WBGetWindowGeom (Window wID, WB_GEOM *pGeom) |
Returns the RAW geometry of the window as reported by the window manager. More... | |
void | WBGetWindowGeom2 (Window wID, WB_GEOM *pGeom) |
Returns the geometry of the window relative to the root window. More... | |
void | WBGetWindowGeom0 (Window wID, WB_GEOM *pGeom) |
Returns the ABSOLUTE window geometry relative to the screen. More... | |
void | WBGetWindowRect (Window wID, WB_RECT *pRect) |
Returns the WB_RECT (rectangle) defined by the window's geometry, including the border area. More... | |
void | WBGetClientRect (Window wID, WB_RECT *pRect) |
Returns the WB_RECT (rectangle) defined by the window's geometry, excluding the border area. More... | |
void | WBXlatCoordPoint (Window wIDSrc, int iXSrc, int iYSrc, Window wIDDest, int *piXDest, int *piYDest) |
Translate X,Y point coordinates relative to a window. More... | |
void | WBXlatCoordGeom (Window wIDSrc, const WB_GEOM *pGeomSrc, Window wIDDest, WB_GEOM *pGeomDest) |
Translate geometry coordinates relative to a window. More... | |
void | WBXlatCoordRect (Window wIDSrc, const WB_RECT *pRectSrc, Window wIDDest, WB_RECT *pRectDest) |
Translate rectangle coordinates relative to a window. More... | |
int | WBPointInWindow (Window wIDRef, int iX, int iY, Window wIDQuery) |
Returna a non-zero value if X,Y coordinates relative to the reference window are within the query window. More... | |
The following functions, data types, and macro definitions are related to window geometries, querying, translating coordinate mapping, and comparing points, rectangles, and geometries to one another.
#define WBGeomOverlapped | ( | G1, | |
G2 | |||
) |
Returns logical TRUE if the geometry G1 overlaps/intersects G2.
G1 | A WB_GEOM structure bounding the first area to check |
G2 | A second WB_GEOM structure bounding the second area to check |
Definition at line 1758 of file window_helper.h.
#define WBPointInGeom | ( | X, | |
Y, | |||
G | |||
) | ((X) >= (G).x && (X) < ((G).x + (G).width) && (Y) >= (G).y && (Y) < ((G).y + (G).height)) |
Returns logical TRUE if the point (X,Y) is within the borders of the geometry 'G'.
X | The X value to check for |
Y | The Y value to check for |
G | A WB_GEOM structure bounding the area to check |
Definition at line 1738 of file window_helper.h.
#define WBPointInRect | ( | X, | |
Y, | |||
R | |||
) | ((X) >= (R).left && (X) < (R).right && (Y) >= (R).top && (Y) < (R).bottom) |
Returns logical TRUE if the point (X,Y) is within the borders of the rectangle 'R'.
X | The X value to check for |
Y | The Y value to check for |
R | A WB_RECT structure bounding the area to check |
Definition at line 1729 of file window_helper.h.
#define WBRectOverlapped | ( | R1, | |
R2 | |||
) |
Returns logical TRUE if the rectangle R1 overlaps/intersects R2.
R1 | A WB_RECT structure bounding the first area to check |
R2 | A second WB_RECT structure bounding the second area to check |
Definition at line 1746 of file window_helper.h.
void WBGetClientRect | ( | Window | wID, |
WB_RECT * | pRect | ||
) |
Returns the WB_RECT (rectangle) defined by the window's geometry, excluding the border area.
wID | The Window ID to obtain the WB_RECT data for |
pRect | A pointer to the WB_RECT structure to receive the data |
Header File: window_helper.h
Definition at line 6708 of file window_helper.c.
void WBGetWindowGeom | ( | Window | wID, |
WB_GEOM * | pGeom | ||
) |
Returns the RAW geometry of the window as reported by the window manager.
wID | The Window ID to obtain the WB_GEOM data for |
pGeom | A pointer to the WB_GEOM structure to receive the data |
Header File: window_helper.h
Definition at line 6522 of file window_helper.c.
void WBGetWindowGeom0 | ( | Window | wID, |
WB_GEOM * | pGeom | ||
) |
Returns the ABSOLUTE window geometry relative to the screen.
wID | The Window ID to obtain the WB_GEOM data for |
pGeom | A pointer to the WB_GEOM structure to receive the data |
The 'ABSOLUTE' window geometry is the position of the window relative to the origin point (the upper left corner of the screen). Window managers typically cook all of the XEvent and API data that relates to window positioning, such that a top level frame window's upper left corner is nearly always reported as 0,0 (or similar). Not all window managers behave the same in this regard. To ensure that an ABSOLUTE window position is known (helpful for centering on screen, etc.), the absolute coordinates are frequently cached within the internal data structure associated with the window. Those cached values are returned by this function.
Header File: window_helper.h
Definition at line 6473 of file window_helper.c.
void WBGetWindowGeom2 | ( | Window | wID, |
WB_GEOM * | pGeom | ||
) |
Returns the geometry of the window relative to the root window.
wID | The Window ID to obtain the WB_GEOM data for |
pGeom | A pointer to the WB_GEOM structure to receive the data |
Header File: window_helper.h
Definition at line 6607 of file window_helper.c.
void WBGetWindowRect | ( | Window | wID, |
WB_RECT * | pRect | ||
) |
Returns the WB_RECT (rectangle) defined by the window's geometry, including the border area.
wID | The Window ID to obtain the WB_RECT data for |
pRect | A pointer to the WB_RECT structure to receive the data |
Header File: window_helper.h
Definition at line 6693 of file window_helper.c.
int WBPointInWindow | ( | Window | wIDRef, |
int | iX, | ||
int | iY, | ||
Window | wIDQuery | ||
) |
Returna a non-zero value if X,Y coordinates relative to the reference window are within the query window.
wIDRef | The reference Window ID |
iX | The X coordinates relative to wIDRef |
iY | The Y coordinates relative to wIDRef |
wIDQuery | The Window ID of the window to test the translated X and Y values against |
Use this function to see if coordinates relative to one window also fall within another window. Typical use includes 'hover' detection, drag/drop operations, and child window activation To specify X,Y screen coordinates, pass 'None' for 'wIDRef'
Header File: window_helper.h
Definition at line 6819 of file window_helper.c.
void WBXlatCoordGeom | ( | Window | wIDSrc, |
const WB_GEOM * | pGeomSrc, | ||
Window | wIDDest, | ||
WB_GEOM * | pGeomDest | ||
) |
Translate geometry coordinates relative to a window.
wIDSrc | The source Window ID |
pGeomSrc | A const pointer to a WB_GEOM structure containing the coordinates to translate |
wIDDest | The destination Window ID |
pGeomDest | A pointer to a WB_GEOM structure that receives the translated coordinates |
For many operations, coordinates relative to one window must be translated into coordinates relative to a different window so that they can be used for the new window's processing.
To translate from screen coordinates, pass 'None' for 'wIDSrc'
Header File: window_helper.h
Definition at line 6762 of file window_helper.c.
void WBXlatCoordPoint | ( | Window | wIDSrc, |
int | iXSrc, | ||
int | iYSrc, | ||
Window | wIDDest, | ||
int * | piXDest, | ||
int * | piYDest | ||
) |
Translate X,Y point coordinates relative to a window.
wIDSrc | The source Window ID |
iXSrc | The X coordinate within wIDSrc |
iYSrc | The Y coordinate within wIDSrc |
wIDDest | The destination Window ID |
piXDest | A pointer to an integer to receive the translated X coordinate |
piYDest | A pointer to an integer to receive the translated Y coordinate |
For many operations, coordinates relative to one window must be translated into coordinates relative to a different window so that they can be used for the new window's processing.
To translate from screen coordinates, pass 'None' for 'wIDSrc'
Header File: window_helper.h
Definition at line 6727 of file window_helper.c.
void WBXlatCoordRect | ( | Window | wIDSrc, |
const WB_RECT * | pRectSrc, | ||
Window | wIDDest, | ||
WB_RECT * | pRectDest | ||
) |
Translate rectangle coordinates relative to a window.
wIDSrc | The source Window ID |
pRectSrc | A const pointer to a WB_RECT structure containing the coordinates to translate |
wIDDest | The destination Window ID |
pRectDest | A pointer to a WB_RECT structure that receives the translated coordinates |
For many operations, coordinates relative to one window must be translated into coordinates relative to a different window so that they can be used for the new window's processing.
To translate from screen coordinates, pass 'None' for 'wIDSrc'
Header File: window_helper.h
Definition at line 6792 of file window_helper.c.