Module xlib

Table of contents

Functions

DefaultScreen(display) Returns the default screen for the given display.
XDisplayName([name]) Returns the display name that XOpenDisplay would attempt to use.
DisplayHeight(display, screen) Returns the height of the given screen in pixels.
DisplayHeight(display, screen) Returns the width of the given screen in pixels.
XOpenDisplay([display_name]) Opens a connection to the given display.
XCloseDisplay(display) Closes a connection.
RootWindow(display) Returns the root window for the given display.
ScreenCount(display) Returns the number of screens for the given display.
XLockDisplay(display) Locks the given display connection for use with the current thread only.
XUnlockDisplay(display) Releases a lock from the given display connection.
XInternAtom(display, name, only_if_exists) Returns an atom identifier for the given name.
XInternAtoms(display, names, only_if_exists) Returns the atom identifier for a list of names.
XGetAtomName(display, atom) Returns the name associated with the given atom.
XGetAtomNames(display, atoms) Returns the names associated with the list of atoms.

Tables

Display

Functions

DefaultScreen(display)
Returns the default screen for the given display.

Parameters:

Returns:

  • type number
XDisplayName([name])
Returns the display name that XOpenDisplay would attempt to use.

If the argument is nil, XLib will check the DISPLAY environment variable.

The main use case of this function is to report the name that XOpenDisplay attempted when the initial connection attempt failed.

Parameters:

Returns:

DisplayHeight(display, screen)
Returns the height of the given screen in pixels.

Parameters:

  • display
    type Display
  • screen
    type number

Returns:

  • type number
DisplayHeight(display, screen)
Returns the width of the given screen in pixels.

Parameters:

  • display
    type Display
  • screen
    type number

Returns:

  • type number
XOpenDisplay([display_name])
Opens a connection to the given display.

The connection is closed automatically when the returned handler is garbage collected (i.e. when it goes out of scope).

Parameters:

  • display_name :  The connection string. When nil, XLib will fall back to the value of the DISPLAY environment variable.
    type string
    optional

Returns:

XCloseDisplay(display)
Closes a connection.

Parameters:

RootWindow(display)
Returns the root window for the given display.

Parameters:

Returns:

  • type number
ScreenCount(display)
Returns the number of screens for the given display.

Parameters:

Returns:

  • type number
XLockDisplay(display)
Locks the given display connection for use with the current thread only.

Other threads attempting to use the same connection will block until it is unlocked with XUnlockDisplay. Calls to this function may be nested.

Parameters:

XUnlockDisplay(display)
Releases a lock from the given display connection.

Parameters:

XInternAtom(display, name, only_if_exists)
Returns an atom identifier for the given name.

Parameters:

  • display
    type Display
  • name
    type string
  • only_if_exists
    type booolean

Returns:

  • type number
XInternAtoms(display, names, only_if_exists)
Returns the atom identifier for a list of names.

Parameters:

  • display
    type Display
  • names :  A list of strings.
    type table
  • only_if_exists
    type boolean

Returns:

  • An Xlib Status.
    type number
  • type table
XGetAtomName(display, atom)
Returns the name associated with the given atom.

Parameters:

  • display
    type Display
  • atom :  An X11 Atom.
    type number

Returns:

XGetAtomNames(display, atoms)
Returns the names associated with the list of atoms.

Parameters:

  • display
    type Display
  • atoms :  A list of numbers.
    type table

Returns:

Tables

Display