X Objects
*********

All X operations are performed by invoking object methods.

The objects and their methods are listed in the following nodes, however with no detailed explanations.  The reader are referred to other sources of X documentation for details, e.g. the X protocol specification, the C Xlib documentation or man pages.  A vast collection of X documentation links can be found at http://www.rahul.net/kenton/xsites.html.

Methods returning a single value will return that directly.  Otherwise, an object containing attributes for each of the result values is returned.

Methods returning some value will raise an exception on error.  Methods which does not return any value have instead an on_error parameter, which can be used to specify an error handler.

Display
=======

Display information retrieval methods:

 -- Method on Display: get_display_name ( )

     Returns the name used to connect to the server, either provided when creating the Display object, or fetched from the environmental variable $DISPLAY.

 -- Method on Display: fileno ( )

     Returns the file descriptor number of the underlying socket.  This method is provided to allow Display objects to be passed select.select().

 -- Method on Display: close ( )

     Close the display, freeing the resources that it holds.

 -- Method on Display: set_error_handler ( handler )

     Set the default error handler which will be called for all unhandled errors.  HANDLER should take two arguments as a normal request error handler, but the second argument (the request) will be None.

     See Error Handling.

 -- Method on Display: flush ( )

     Flush the request queue, building and sending the queued requests.  This can be necessary in applications that never wait for events, and in threaded applications.

 -- Method on Display: sync ( )

     Flush the queue and wait until the server has processed all the queued requests.  Use this e.g. when it is important that errors caused by a certain request is trapped.

 -- Method on Display: next_event ( )

     Return the next event.  If there are no events queued, it will block until the next event is fetched from the server.

 -- Method on Display: pending_events ( )

     Return the number of events queued, i.e. the number of times that Display.next_event() can be called without blocking.

 -- Method on Display: has_extension ( extension )

     Check if both the server and the client library support the X extension named EXTENSION.

 -- Method on Display: create_resource_object ( type, id )

     Create a resource object of TYPE for the integer ID. TYPE should be one of the following strings:

     resource
     drawable
     window
     pixmap
     fontable
     font
     gc
     colormap
     cursor

     This function can be used when a resource ID has been fetched e.g. from an resource or a command line argument.  Resource objects should never be created by instantiating the appropriate class directly, since any X extensions dynamically added by the library will not be available.

 -- Method on Display: screen ( sno = None )

     Return the information about screen number SNO, or the default screen if SNO is None.

     The return object has the following attributes:

     root
          The screen root window.

     default_colormap
          The default colormap for the root window and its children.

     white_pixel
     black_pixel
          The pixel values for white and black, respectively, in the default colormap.

     current_input_mask
          The event mask of the root window at the time the connection was set up.

     width_in_pixels
     height_in_pixels
          The size of the root window in pixels, i.e. the size of the entire screen.

     width_in_mms
     height_in_mms
          The physical size of the screen, in millimeters.

     min_installed_maps
     max_installed_maps
          The minimum and maximum number of colormaps that can be installed at the same time.

     root_visual
          The visual type of the root window.

     backing_store
          Whether the screen supports backing store, one of the values X.WhenMapped, X.NotUseful, or X.Always.

     save_unders
          True if the screen supports save unders.

     root_depth
          The depth of the root window.

     allowed_depths

          A list of the pixmap and windows depths that this screen supports.  The list items have the following attributes:

          depth
               This depth is supported by the screen.

          visuals
               A list of visual types that is valid for this depth.  If this list is empty, this depth is only valid for pixmaps and not for windows.  The list items have the following attributes:

               visual_id
                    The ID of this visual.

               visual_class
                    One of X.StaticGray, X.StaticColor, X.TrueColor, X.GrayScale, X.PseudoColor, or X.DirectColor.

               bits_per_rgb_value
                    The number of bits used to represent an entire RGB-value, allowing a total of 2^bits_per_rgb_value distinct colors.

               colormap_entries
                    The number of free entries in a newly created colormap.

               red_mask
               blue_mask
               green_mask

                    Bitmasks selecting the three color components from the entire RGB value.

 -- Method on Display: screen_count ( )

     Return the total number of screens on the display.

 -- Method on Display: get_default_screen ( )

     Return the number of the default screen, extracted from the display name.

 -- Method on Display: keycode_to_keysym ( keycode, index )

     Convert a KEYCODE to a keysym, looking in entry INDEX. Normally index 0 is unshifted, 1 is shifted, 2 is alt grid, and 3 is shift+alt grid.  If that key entry is not bound, X.NoSymbol is returned.

 -- Method on Display: keysym_to_keycode ( keysym )

     Look up the primary keycode that is bound to KEYSYM.  If several keycodes are found, the one with the lowest index and lowest code is returned.  If KEYSYM is not bound to any key, 0 is returned.

 -- Method on Display: keysym_to_keycodes ( keysym )

     Look up all the keycodes that is bound to keysym.  A list of tuples (keycode, index) is returned, sorted primarily on the lowest index and secondarily on the lowest keycode.

 -- Method on Display: refresh_keyboard_mapping ( evt )

     This method should be called once when a MappingNotify event is received, to update the keymap cache.  EVT should be the event object.

 -- Method on Display: lookup_string ( keysym )

     Attempt to convert KEYSYM into a single character or a string.  If no translation is found, None is returned.

 -- Method on Display: rebind_string ( keysym, newstring )

     Set the string representation of keysym to newstring, so that it will be returned by Display.lookup_string().

X requests methods:

 -- Method on Display: intern_atom ( name, only_if_exists = 0 )

     Intern the string NAME, returning its atom number.  If ONLY_IF_EXISTS is true and the atom does not already exist, it will not be created and X.NONE is returned.

 -- Method on Display: get_atom_name ( atom )

     Look up the name of ATOM, returning it as a string.  Will raise BadAtom if ATOM does not exist.

 -- Method on Display: get_selection_owner ( selection )

     Return the window that owns SELECTION (an atom), or X.NONE if there is no owner for the selection.  Can raise BadAtom.

 -- Method on Display: send_event ( destination, event, event_mask = 0, propagate = 0, onerror = None )

     Send a synthetic event to the window destination which can be a window object, or X.PointerWindow or X.InputFocus. event is the event object to send, instantiated from one of the classes in protocol.events.  See XSendEvent(3X11) for details.

     There is also a Window.send_event() method.

 -- Method on Display: ungrab_pointer ( time, onerror = None )

     Release a grabbed pointer and any queued events.  See XUngrabPointer(3X11).

 -- Method on Display: change_active_pointer_grab ( event_mask, cursor, time, onerror = None )

     Change the dynamic parameters of a pointer grab.  See XChangeActivePointerGrab(3X11).

 -- Method on Display: ungrab_keyboard ( time, onerror = None )

     Ungrab a grabbed keyboard and any queued events.  See XUngrabKeyboard(3X11).

 -- Method on Display: allow_events ( mode, time, onerror = None )

     Release some queued events.  MODE should be one of X.AsyncPointer, X.SyncPointer, X.AsyncKeyboard, X.SyncKeyboard, X.ReplayPointer, X.ReplayKeyboard, X.AsyncBoth, or X.SyncBoth.  TIME should be a timestamp or X.CurrentTime.

 -- Method on Display: grab_server ( onerror = None )

     Disable processing of requests on all other client connections until the server is ungrabbed.  Server grabbing should be avoided as much as possible.

 -- Method on Display: ungrab_server ( onerror = None )

     Release the server if it was previously grabbed by this client.

 -- Method on Display: warp_pointer ( x, y, src_window = X.NONE, src_x = 0, src_y = 0, src_width = 0, src_height = 0, onerror = None )

     Move the pointer relative its current position by the offsets (X, Y).  However, if SRC_WINDOW is a window the pointer is only moved if the specified rectangle in SRC_WINDOW contains it.  If SRC_WIDTH is 0 it will be replaced with the width of SRC_WINDOW - SRC_X.  SRC_HEIGHT is treated in a similar way.

     To move the pointer to absolute coordinates, use Window.warp_pointer().

 -- Method on Display: set_input_focus ( focus, revert_to, time, onerror = None )

     Set input focus to FOCUS, which should be a window, X.PointerRoot or X.NONE.  REVERT_TO specifies where the focus reverts to if the focused window becomes not visible, and should be X.RevertToParent, RevertToPointerRoot, or RevertToNone.  See XSetInputFocus(3X11) for details.

     There is also a Window.set_input_focus().

 -- Method on Display: get_input_focus ( )

     Return an object with the following attributes:

     focus
          The window which currently holds the input focus, X.NONE or X.PointerRoot.

     revert_to
          Where the focus will revert, one of X.RevertToParent, RevertToPointerRoot, or RevertToNone.

 -- Method on Display: query_keymap ( )

     Return a bit vector for the logical state of the keyboard, where each bit set to 1 indicates that the corresponding key is currently pressed down.  The vector is represented as a list of 32 integers.  List item N contains the bits for keys 8N to 8N + 7 with the least significant bit in the byte representing key 8N.

 -- Method on Display: open_font ( name )

     Open the font identifed by the pattern NAME and return its font object.  If NAME does not match any font, None is returned.

 -- Method on Display: list_fonts ( pattern, max_names )

     Return a list of font names matching PATTERN.  No more than MAX_NAMES will be returned.

 -- Method on Display: list_fonts_with_info ( pattern, max_names )

     Return a list of fonts matching PATTERN.  No more than MAX_NAMES will be returned.  Each list item represents one font and has the following properties:

     name
          The name of the font.

     min_bounds
     max_bounds
     min_char_or_byte2
     max_char_or_byte2
     default_char
     draw_direction
     min_byte1
     max_byte1
     all_chars_exist
     font_ascent
     font_descent
     replies_hint
          See the description of XFontStruct in XGetFontProperty(3X11) for details on these values.

     properties
          A list of properties.  Each entry has two attributes:

          name
               The atom identifying this property.

          value
               A 32-bit unsigned value.

 -- Method on Display: set_font_path ( path, onerror = None )

     Set the font path to PATH, which should be a list of strings.  If PATH is empty, the default font path of the server will be restored.

 -- Method on Display: get_font_path ( )

     Return the current font path as a list of strings.

 -- Method on Display: query_extension ( name )

     Ask the server if it supports the extension NAME.  If it is supported an object with the following attributes is returned:

     major_opcode
          The major opcode that the requests of this extension uses.

     first_event
          The base event code if the extension have additional events, or 0.

     first_error
          The base error code if the extension have additional errors, or 0.

     If the extension is not supported, None is returned.

 -- Method on Display: list_extensions ( )

     Return a list of all the extensions provided by the server.

 -- Method on Display: change_keyboard_mapping ( first_keycode, keysyms, onerror = None )

     Modify the keyboard mapping, starting with FIRST_KEYCODE. KEYSYMS is a list of tuples of keysyms.  keysyms[n][i] will be assigned to keycode first_keycode+n at index i.

 -- Method on Display: get_keyboard_mapping ( first_keycode, count )

     Return the current keyboard mapping as a list of tuples, starting at FIRST_KEYCOUNT and no more than COUNT.

 -- Method on Display: change_keyboard_control ( onerror = None, **keys )

     Change the parameters provided as keyword arguments:

     key_click_percent
          The volume of key clicks between 0 (off) and 100 (load).  -1 will restore default setting.

     bell_percent
          The base volume of the bell, coded as above.

     bell_pitch
          The pitch of the bell in Hz, -1 restores the default.

     bell_duration
          The duration of the bell in milliseconds, -1 restores the default.

     led
     led_mode
          led_mode should be X.LedModeOff or X.LedModeOn.  If led is provided, it should be a 32-bit mask listing the LEDs that should change.  If led is not provided, all LEDs are changed.

     key
     auto_repeat_mode
          auto_repeat_mode should be one of X.AutoRepeatModeOff, X.AutoRepeatModeOn, or X.AutoRepeatModeDefault.  If key is provided, that key will be modified, otherwise the global state for the entire keyboard will be modified.

 -- Method on Display: get_keyboard_control ( )

     Return an object with the following attributes:

     global_auto_repeat
          X.AutoRepeatModeOn or X.AutoRepeatModeOff.

     auto_repeats
          A list of 32 integers.  List item N contains the bits for keys 8N to 8N + 7 with the least significant bit in the byte representing key 8N.  If a bit is on, autorepeat is enabled for the corresponding key.

     led_mask
          A 32-bit mask indicating which LEDs are on.

     key_click_percent
          The volume of key click, from 0 to 100.

     bell_percent
     bell_pitch
     bell_duration
          The volume, pitch and duration of the bell.

 -- Method on Display: bell ( percent = 0, onerror = None )

     Ring the bell at the volume PERCENT which is relative the base volume.  See XBell(3X11).

 -- Method on Display: change_pointer_control ( accel = None, threshold = None, onerror = None )

     To change the pointer acceleration, set ACCEL to a tuple (num, denum).  The pointer will then move num/denum times the normal speed if it moves beyond the threshold number of pixels at once.  To change the threshold, set it to the number of pixels.  -1 restores the default.

 -- Method on Display: get_pointer_control ( )

     Return an object with the following attributes:

     accel_num
     accel_denom
          The acceleration as numerator/denumerator.

     threshold
          The number of pixels the pointer must move before the acceleration kicks in.

 -- Method on Display: set_screen_saver ( timeout, interval, prefer_blank, allow_exposures, onerror = None )

     See XSetScreenSaver(3X11).

 -- Method on Display: get_screen_saver ( )

     Return an object with the attributes timeout, interval, prefer_blanking, allow_exposures.  See XGetScreenSaver(3X11) for details.

 -- Method on Display: change_hosts ( mode, host_family, host, onerror = None )

     MODE is either X.HostInsert or X.HostDelete. HOST_FAMILY is one of X.FamilyInternet, X.FamilyDECnet, X.FamilyChaos, X.FamilyServerInterpreted or X.FamilyInternetV6.

     HOST is a list of bytes.  For the Internet family, it should be the four bytes of an IPv4 address.

 -- Method on Display: list_hosts ( )

     Return an object with the following attributes:

     mode
          X.EnableAccess if the access control list is used, X.DisableAccess otherwise.

     hosts
          The hosts on the access list.  Each entry has the following attributes:

          family
               X.FamilyInternet, X.FamilyDECnet, X.FamilyChaos, X.FamilyServerInterpreted or X.FamilyInternetV6.

          name
               A list of byte values, the coding depends on family.  For the Internet family, it is the 4 bytes of an IPv4 address.

 -- Method on Display: set_access_control ( mode, onerror = None )

     Enable use of access control lists at connection setup if MODE is X.EnableAccess, disable if it is X.DisableAccess.

 -- Method on Display: set_close_down_mode ( mode, onerror = None )

     Control what will happen with the client's resources at connection close.  The default is X.DestroyAll, the other values are X.RetainPermanent and X.RetainTemporary.

 -- Method on Display: force_screen_saver ( mode, onerror = None )

     If MODE is X.ScreenSaverActive the screen saver is activated.  If it is X.ScreenSaverReset, the screen saver is deactivated as if device input had been received.

 -- Method on Display: set_pointer_mapping ( map )

     Set the mapping of the pointer buttons.  MAP is a list of logical button numbers.  MAP must be of the same length as the list returned by Display.get_pointer_mapping().

     map[n] sets the logical number for the physical button n+1.  Logical number 0 disables the button.  Two physical buttons cannot be mapped to the same logical number.

     If one of the buttons to be altered are logically in the down state, X.MappingBusy is returned and the mapping is not changed. Otherwise the mapping is changed and X.MappingSuccess is returned.

 -- Method on Display: get_pointer_mapping ( )

     Return a list of the pointer button mappings.  Entry N in the list sets the logical button number for the physical button N+1.

 -- Method on Display: set_modifier_mapping ( keycodes )

     Set the keycodes for the eight modifiers X.Shift, X.Lock, X.Control, X.Mod1, X.Mod2, X.Mod3, X.Mod4 and X.Mod5.  KEYCODES should be a eight-element list where each entry is a list of the keycodes that should be bound to that modifier.

     If any changed key is logically in the down state, X.MappingBusy is returned and the mapping is not changed.  If the mapping violates some server restriction, X.MappingFailed is returned.  Otherwise the mapping is changed and X.MappingSuccess is returned.

 -- Method on Display: get_modifier_mapping ( )

     Return a list of eight lists, one for each modifier.  The list can be indexed using X.ShiftMapIndex, X.Mod1MapIndex, and so on. The sublists list the keycodes bound to that modifier.

 -- Method on Display: no_operation ( onerror = None )

     Do nothing but send a request to the server.

Resource
========

All resource objects can be compared and hashed, so they can be used as mapping indices.  They also have this method:

 -- Method on Resource: kill_client ( onerror = None )

Colormap
========

See Resource, for additional methods on Colormap objects.

 -- Method on Colormap: free ( onerror = None )

 -- Method on Colormap: copy_colormap_and_free ( scr_cmap )
     Returns Colormap.

 -- Method on Colormap: install_colormap ( onerror = None )

 -- Method on Colormap: uninstall_colormap ( onerror = None )

 -- Method on Colormap: alloc_color ( red, green, blue )

 -- Method on Colormap: alloc_named_color ( name )
     Returns None or  Card32('pixel'), Card16('exact_red'), Card16('exact_green'), Card16('exact_blue'), Card16('screen_red'), Card16('screen_green'), Card16('screen_blue'),

 -- Method on Colormap: alloc_color_cells ( contiguous, colors, planes )
     Returns  List('pixels', Card32Obj), List('masks', Card32Obj),

 -- Method on Colormap: alloc_color_planes ( contiguous, colors, red, green, blue )
     Returns  Card32('red_mask'), Card32('green_mask'), Card32('blue_mask'), List('pixels', Card32Obj),

 -- Method on Colormap: free_colors ( pixels, plane_mask, onerror = None )

 -- Method on Colormap: store_colors ( items, onerror = None )

 -- Method on Colormap: store_named_color ( name, pixel, flags, onerror = None )

 -- Method on Colormap: query_colors ( pixels )
     Returns List('colors', structs.RGB),

 -- Method on Colormap: lookup_color ( name )
     Returns  Card16('exact_red'), Card16('exact_green'), Card16('exact_blue'), Card16('screen_red'), Card16('screen_green'), Card16('screen_blue'),

Cursor
======

See Resource, for additional methods on Cursor objects.

 -- Method on Cursor: free ( onerror = None )

 -- Method on Cursor: recolor ( (fore_red, fore_green, fore_blue), (back_red, back_green, back_blue), onerror = None )

Drawable
========

Drawable is a base class of Window and Pixmap objects.  See Window, and Pixmap.

See Resource, for additional methods.

 -- Method on Drawable: get_geometry ( )
     Returns Window('root'), Int16('x'), Int16('y'), Card16('width'), Card16('height'), Card16('border_width'),

 -- Method on Drawable: create_pixmap ( width, height, depth )
     Returns Pixmap.

 -- Method on Drawable: create_gc ( **keys )
     Returns GC.

 -- Method on Drawable: copy_area ( gc, src_drawable, src_x, src_y, width, height, dst_x, dst_y, onerror = None )

 -- Method on Drawable: copy_plane ( gc, src_drawable, src_x, src_y, width, height, dst_x, dst_y, bit_plane, onerror = None )

 -- Method on Drawable: poly_point ( gc, coord_mode, points, onerror = None )

request.PolyPoint(display = self.display, onerror = onerror, coord_mode = coord_mode, drawable = self.id, gc = gc, points = points)

 -- Method on Drawable: point ( gc, x, y, onerror = None )

 -- Method on Drawable: poly_line ( gc, coord_mode, points, onerror = None )

 -- Method on Drawable: line ( gc, x1, y1, x2, y2, onerror = None )

 -- Method on Drawable: poly_segment ( gc, segments, onerror = None )

 -- Method on Drawable: poly_rectangle ( gc, rectangles, onerror = None )

 -- Method on Drawable: rectangle ( gc, x, y, width, height, onerror = None )

 -- Method on Drawable: poly_arc ( gc, arcs, onerror = None )

 -- Method on Drawable: arc ( gc, x, y, width, height, angle1, angle2, onerror = None )

 -- Method on Drawable: fill_poly ( gc, shape, coord_mode, points, onerror = None )

 -- Method on Drawable: poly_fill_rectangle ( gc, rectangles, onerror = None )

 -- Method on Drawable: fill_rectangle ( gc, x, y, width, height, onerror = None )

 -- Method on Drawable: poly_fill_arc ( gc, arcs, onerror = None )

 -- Method on Drawable: fill_arc ( gc, x, y, width, height, angle1, angle2, onerror = None )

 -- Method on Drawable: put_image ( )
     Not implemented yet.

 -- Method on Drawable: get_image ( )
     Not implemented yet.

 -- Method on Drawable: draw_text ( gc, x, y, text, onerror = None )

 -- Method on Drawable: poly_text ( gc, x, y, items, onerror = None )

 -- Method on Drawable: poly_text_16 ( gc, x, y, items, onerror = None )

 -- Method on Drawable: image_text ( gc, x, y, string, onerror = None )

 -- Method on Drawable: image_text_16 ( gc, x, y, string, onerror = None )

 -- Method on Drawable: query_best_size ( item_class, width, height )
     Returns Card16('width'), Card16('height'),

Window
======

Window objects have additional objects, see Resource and Drawable.

 -- Method on Window: create_window ( x, y, width, height, border_width, depth, window_class = X.CopyFromParent, visual = X.CopyFromParent, **keys )
     Returns Window

 -- Method on Window: change_attributes ( onerror = None, **keys )

 -- Method on Window: get_attributes ( )
     Returns Card8('backing_store'), Card32('visual'), Card16('class'), Card8('bit_gravity'), Card8('win_gravity'), Card32('backing_bit_planes'), Card32('backing_pixel'), Card8('save_under'), Card8('map_is_installed'), Card8('map_state'), Card8('override_redirect'), Colormap('colormap', (X.NONE, )), Card32('all_event_masks'), Card32('your_event_mask'), Card16('do_not_propagate_mask'),

 -- Method on Window: destroy ( onerror = None )

 -- Method on Window: destroy_sub_windows ( onerror = None )

 -- Method on Window: change_save_set ( mode, onerror = None )

 -- Method on Window: reparent ( parent, x, y, onerror = None )

 -- Method on Window: map ( onerror = None )

 -- Method on Window: map_sub_windows ( onerror = None )

 -- Method on Window: unmap ( onerror = None )

 -- Method on Window: unmap_sub_windows ( onerror = None )

 -- Method on Window: configure ( onerror = None, **keys )

 -- Method on Window: circulate ( direction, onerror = None )

 -- Method on Window: query_tree ( )
     Returns Window('root'), Window('parent', (X.NONE, )), List('children', WindowObj),

 -- Method on Window: change_property ( property, type, format, data, mode = X.PropModeReplace, onerror = None )

 -- Method on Window: delete_property ( property, onerror = None )

 -- Method on Window: get_property ( property, type, offset, length, delete = 0 )
     Returns None or Card32('property_type'), Card8('format'), PropertyData('value'), Card32('bytes_after'),

 -- Method on Window: get_full_property ( property, type, sizehint = 10 )
     Returns None or Card32('property_type'), Card8('format'), PropertyData('value'), Card32('bytes_after'),

 -- Method on Window: list_properties ( )
     Returns List('atoms', Card32Obj),

 -- Method on Window: set_selection_owner ( selection, time, onerror = None )

 -- Method on Window: convert_selection ( selection, target, property, time, onerror = None )

 -- Method on Window: send_event ( event, event_mask = 0, propagate = 0, onerror = None )

 -- Method on Window: grab_pointer ( owner_events, event_mask, pointer_mode, keyboard_mode, confine_to, cursor, time )
     Returns Card8('status'),

 -- Method on Window: grab_button ( button, modifiers, owner_events, event_mask, pointer_mode, keyboard_mode, confine_to, cursor, onerror = None )

 -- Method on Window: ungrab_button ( button, modifiers, onerror = None )

 -- Method on Window: grab_keyboard ( owner_events, pointer_mode, keyboard_mode, time )
     Returns Card8('status'),

 -- Method on Window: grab_key ( key, modifiers, owner_events, pointer_mode, keyboard_mode, onerror = None )

 -- Method on Window: ungrab_key ( key, modifiers, onerror = None )

 -- Method on Window: query_pointer ( )
     Returns Card8('same_screen'), Window('root'), Window('child', (X.NONE, )), Int16('root_x'), Int16('root_y'), Int16('win_x'), Int16('win_y'), Card16('mask'),

 -- Method on Window: get_motion_events ( start, stop )
     Returns List('events', structs.TimeCoord),

 -- Method on Window: translate_coords ( src_window, src_x, src_y )
     Returns Window('child', (X.NONE, )), Int16('x'), Int16('y'),

 -- Method on Window: warp_pointer ( x, y, src_window = 0, src_x = 0, src_y = 0, src_width = 0, src_height = 0, onerror = None )

 -- Method on Window: set_input_focus ( revert_to, time, onerror = None )

 -- Method on Window: clear_area ( x = 0, y = 0, width = 0, height = 0, exposures = 0, onerror = None )

 -- Method on Window: create_colormap ( visual, alloc )
     Returns Colormap.

 -- Method on Window: list_installed_colormaps ( )
     Returns List('cmaps', ColormapObj),

 -- Method on Window: rotate_properties ( properties, delta, onerror = None )

 -- Method on Window: set_wm_name ( name, onerror = None )

 -- Method on Window: get_wm_name ( )
     Returns None or string.

 -- Method on Window: set_wm_icon_name ( name, onerror = None )

 -- Method on Window: get_wm_icon_name ( )
     Returns None or string.

 -- Method on Window: set_wm_class ( inst, cls, onerror = None )

 -- Method on Window: get_wm_class ( )
     Returns None or (instance, class)

 -- Method on Window: set_wm_transient_for ( window, onerror = None )

 -- Method on Window: get_wm_transient_for ( )
     Returns None or Window.

 -- Method on Window: set_wm_protocols ( protocols, onerror = None )

 -- Method on Window: get_wm_protocols ( )
     Returns list of atoms.

 -- Method on Window: set_wm_colormap_windows ( windows, onerror = None )

 -- Method on Window: get_wm_colormap_windows ( )
     Returns list of Windows.

 -- Method on Window: set_wm_client_machine ( name, onerror = None )

 -- Method on Window: get_wm_client_machine ( )
     Returns None or string.

 -- Method on Window: set_wm_normal_hints ( hints = , onerror = None, **keys )

 -- Method on Window: get_wm_normal_hints ( )
     Returns  Card32('flags'), Int32('min_width', default = 0), Int32('min_height', default = 0), Int32('max_width', default = 0), Int32('max_height', default = 0), Int32('width_inc', default = 0), Int32('height_inc', default = 0), Object('min_aspect', Aspect, default = (0, 0)), Object('max_aspect', Aspect, default = (0, 0)), Int32('base_width', default = 0), Int32('base_height', default = 0), Int32('win_gravity', default = 0),

 -- Method on Window: set_wm_hints ( hints = , onerror = None, **keys )

 -- Method on Window: get_wm_hints ( )
     Returns Card32('flags'), Card32('input', default = 0), Set('initial_state', 4, ( Xutil.NormalState, Xutil.IconicState ), default = Xutil.NormalState), Pixmap('icon_pixmap', default = 0), Window('icon_window', default = 0), Int32('icon_x', default = 0), Int32('icon_y', default = 0), Pixmap('icon_mask', default = 0), Window('window_group', default = 0),

 -- Method on Window: set_wm_state ( hints = , onerror = None, **keys )

 -- Method on Window: get_wm_state ( )
     Returns  Set('state', 4, ( Xutil.WithdrawnState, Xutil.NormalState, Xutil.IconicState )), Window('icon', ( X.NONE, )),

 -- Method on Window: set_wm_icon_size ( hints = , onerror = None, **keys )

 -- Method on Window: get_wm_icon_size ( )
     Returns Card32('min_width'), Card32('min_height'), Card32('max_width'), Card32('max_height'), Card32('width_inc'), Card32('height_inc'),

Pixmap
======

Pixmap objects have additional objects, see Resource and Drawable.

 -- Method on Pixmap: free ( onerror = None )

 -- Method on Pixmap: create_cursor ( mask, (fore_red, fore_green, fore_blue), (back_red, back_green, back_blue), x, y )
     Returns Cursor.

Fontable
========

Fontable is a base class of GC and Font objects.  See GC, and Font.

See Resource, for additional methods.

 -- Method on Fontable: query ( )
     Returns Object('min_bounds', structs.CharInfo), Object('max_bounds', structs.CharInfo), Card16('min_char_or_byte2'), Card16('max_char_or_byte2'), Card16('default_char'), Card8('draw_direction'), Card8('min_byte1,'), Card8('max_byte1,'), Card8('all_chars_exist'), Int16('font_ascent'), Int16('font_descent'), List('properties', structs.FontProp), List('char_infos', structs.CharInfo),

 -- Method on Fontable: query_text_extents ( string )
     Returns Card8('draw_direction'), Int16('font_ascent'), Int16('font_descent'), Int16('overall_ascent'), Int16('overall_descent'), Int32('overall_width'), Int32('overall_left'), Int32('overall_right'),

GC
==

GC objects have additional objects, see Resource and Fontable.

 -- Method on GC: change ( onerror = None, **keys )

 -- Method on GC: copy ( src_gc, mask, onerror = None )

 -- Method on GC: set_dashes ( offset, dashes, onerror = None )

 -- Method on GC: set_clip_rectangles ( x_origin, y_origin, rectangles, ordering, onerror = None )

 -- Method on GC: free ( onerror = None )

Font
====

Font objects have additional objects, see Resource and Fontable.

 -- Method on Font: close ( onerror = None )

 -- Method on Font: create_glyph_cursor ( mask, source_char, mask_char, (fore_red, fore_green, fore_blue), (back_red, back_green, back_blue) )
     Returns Cursor.