Package io.github.kingpulse
Class XFacade
- java.lang.Object
-
- io.github.kingpulse.XFacade
-
public class XFacade extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgetWindowLocation(xdo_t xdo, com.sun.jna.platform.unix.X11.Window window, com.sun.jna.ptr.IntByReference x, com.sun.jna.ptr.IntByReference y)This is fixes a bug in the current xdotool displaying the incorrect location.voidmoveWindowSync(xdo_t xdo, com.sun.jna.platform.unix.X11.Window window, int x, int y)voidmoveWindowSync(xdo_t xdo, com.sun.jna.platform.unix.X11.Window window, int x, int y, int timeLimit, int sleepTime)Blocks until the window passed window has been moved/considered synced.com.sun.jna.platform.unix.X11.Window[]searchWindows(xdo_t xdo, xdo_search_t search)Performs the xdo_search_windows function and performs required conversions.
-
-
-
Constructor Detail
-
XFacade
public XFacade()
Ensures attempted load of libxdo and libx11. Uses "xdo" and "X11" for names. xdotool will likely require libx11 installation for a long time considering the low maintenance of the repository. However, the libx11 dependency MAY be removed in the future: https://github.com/jordansissel/xdotool/blob/master/Makefile#L145
-
XFacade
public XFacade(xdotool lib, com.sun.jna.platform.unix.X11 x11lib)
- Parameters:
lib- loaded xdotool libraryx11lib- loaded x11 library
-
-
Method Detail
-
searchWindows
public com.sun.jna.platform.unix.X11.Window[] searchWindows(xdo_t xdo, xdo_search_t search)
Performs the xdo_search_windows function and performs required conversions.- Parameters:
xdo- xdo_t instancesearch- search structure defining the search- Returns:
- Array of X11 windows matching the search
-
moveWindowSync
public void moveWindowSync(xdo_t xdo, com.sun.jna.platform.unix.X11.Window window, int x, int y, int timeLimit, int sleepTime) throws XDoException
Blocks until the window passed window has been moved/considered synced. IMPORTANT: If moving window less than getMaxXPad in x direction and getMaxYPad in y direction, this function is less efficient than directly calling xdo_move_window and cannot guarantee the sync. The sync status is calculated by calculating difference in the current window position to new position. X Window manager imposed borders remove the identity mapping from passed x,y coordinates to the realised coordinates. Due to this the tolerance for these calculations is getMaxXPad and getMaxYPad for the x,y directions.- Parameters:
xdo- xdo_t instancewindow- Window to movex- X coordinate - Will unlikely be exact coordinate of moved window (see above)y- Y coordinate - Will unlikely be exact coordinate of moved window (see above)timeLimit- Maximum amount of time to wait for the syncsleepTime- Time to sleep between each sync check- Throws:
XDoException- If timeLimit is reached, XDoException is thrown
-
moveWindowSync
public void moveWindowSync(xdo_t xdo, com.sun.jna.platform.unix.X11.Window window, int x, int y) throws XDoException
- Throws:
XDoException
-
getWindowLocation
public void getWindowLocation(xdo_t xdo, com.sun.jna.platform.unix.X11.Window window, com.sun.jna.ptr.IntByReference x, com.sun.jna.ptr.IntByReference y)
This is fixes a bug in the current xdotool displaying the incorrect location. Until that is fixed, this will work.- Parameters:
xdo- xdo_t instancewindow- window to get location of
-
-