Subversion Repositories Programming Utils

Rev

Blame | Last modification | View Log | RSS feed

/**
 * libwmstatus - get information form the window manager
 */


#ifndef LIBWMSTATUS_H
#define LIBWMSTATUS_H

#include <X11/Xlib.h>

/**
 * Initialize the connection to the window manager
 */

int wm_init();

/**
 * Get the number of desktops the window manager has
 */

int wm_get_number_desktops();

/**
 * Switch to the given desktop
 */

void wm_switch_to_desktop( int desktop );

/**
 * Activate the given window
 *
 * @param xid The XID of the window to activate
 */

void wm_activate_window( int xid );

/**
 * Close the given window
 *
 * @param xid The window to close
 */

void wm_close_window( int xid );

/**
 * Move the given window to the current desktop
 *
 * @param xid The window to move
 * @param desktop The desktop to move the window to, -1 means 'current'
 */

void wm_move_window_to_desktop( int xid, int desktop );

/**
 * Resize the window
 *
 * @param xid The window to resize
 * @param wid The width of the window
 * @param height The height of the window
 */

void wm_window_resize( int xid, int wid, int height );

/**
 * Get the size of the window.  Return -1 if window not found
 *
 * @param xid The window to get the size of
 * @param wid The returned window size
 * @param height The returned window height
 * @return -1 if window not found
 */

int wm_get_window_size( int xid, int* wid, int* height );

/**
 * Move the window
 *
 * @param xid The window to move
 * @param xpos The X position of the window
 * @param ypos The Y position of the window
 */

void wm_window_move( int xid, int xpos, int ypos );

/**
 * Get the location of the window
 *
 * @param xid The window to get the location of
 * @param xpos The returned xpos
 * @param ypos The returned ypos
 * @return -1 if window not found/some other error
 */

int wm_get_window_location( int xid, int* xpos, int* ypos );

/**
 * Set the long title of the winodw
 *
 * @param xid The window to set the title on
 * @param title The title to set
 */

void wm_window_set_ltitle( int xid, char* title );

/**
 * Set the short title of the winodw
 *
 * @param xid The window to set the title on
 * @param title The title to set
 */

void wm_window_set_stitle( int xid, char* title );

/**
 * Unmap the given window
 *
 * @param xid The window to unmap
 */

void wm_window_unmap( int xid );

/**
 * Get the XID of a window with the given PID
 * This returns the first window that it finds
 *
 * @param pid The PID to look for
 */

int wm_window_get_xid_for_pid( int pid );

/**
 * Get the currently active window
 *
 * @return the XID of the currenly active window
 */

int wm_get_current_window();

/**
 * Check to see if the given XID is valid
 *
 * @param xid The XID to check for
 * @return 1 if valid, 0 otherwise
 */

int wm_check_xid( int xid );

/**
 * Get the XID for the given name.  Returns 0 if not found
 *
 * @param name The name of the window
 * @return The XID of the first window with this name
 */

int wm_get_xid_for_name( const char* name );

/**
 * Get the specified property for the specified window.  
 *
 * @param xid The XID to get the property from
 * @param prop The property to get
 * @return The property.  This string must be free'd
 */

char* wm_get_window_property( int xid, const char* property );

/**
 * Get all the windows that are currently on the screen. This is an array of windows, NULL terminated
 *
 * @param subwindows
 */

Window* wm_get_all_windows( );

#endif