gnu.x11
Class Display

java.lang.Object
  extended by gnu.x11.Display

public class Display
extends java.lang.Object

X server connection.


Nested Class Summary
static class Display.ExtensionInfo
          Information about an X extension.
static class Display.Host
          Information about a host.
static class Display.HostsInfo
          Hosts currently on the access control list and whether use of the list at connection setup is currently enabled or disabled.
static class Display.Name
          X display name.
static class Display.ScreenSaverInfo
          Informations about the screensaver.
 
Field Summary
static int ACTIVATE
           
 java.util.Hashtable atom_ids
           
 java.util.Hashtable atom_names
           
 boolean big_requests_present
           
 int bitmap_format_bit_order
           
 int bitmap_format_scanline_pad
           
 int bitmap_format_scanline_unit
           
 boolean connected
          Indicates if this display is connected or not.
static int CURRENT_TIME
           
static int DEFAULT
           
 Color default_black
           
 Colormap default_colormap
           
 int default_depth
           
 GC default_gc
           
 Pixmap.Format default_pixmap_format
           
 Window default_root
           
 Screen default_screen
           
 int default_screen_no
           
 Color default_white
           
static int DELETE
           
static int DESTROY
           
static int DISABLE
           
 int display_no
          The display number.
static int ENABLE
           
 int extended_maximum_request_length
           
 ErrorFactory[] extension_error_factories
          Error codes 128 through 255 are reserved for extensiones, totally 128.
 EventFactory[] extension_event_factories
          Event codes 64 through 127 are reserved for extensiones, totally 64.
 java.lang.String[][] extension_minor_opcode_strings
           
 java.lang.String[] extension_opcode_strings
          Major opcodes 128 through 255 are reserved for extensions, totally 128.
 java.lang.String hostname
          The hostname to this display.
 int image_byte_order
           
 ResponseInputStream in
          The input stream.
 Input input
           
static int INSERT
           
 int maximum_request_length
           
static int NO
           
 RequestOutputStream out
          The output stream.
 Pixmap.Format[] pixmap_formats
           
 int release_no
           
static int RESET
           
 int resource_base
           
 int resource_index
           
 int resource_mask
           
 java.util.Hashtable resources
           
static int RETAIN_PERMANENT
           
static int RETAIN_TEMPORARY
           
static java.lang.String[] SCREEN_SAVER_STRINGS
           
 Screen[] screens
           
 boolean use_xcmisc
           
 java.lang.String vendor
           
 XCMisc xcmisc
           
 int xcmisc_resource_base
           
 int xcmisc_resource_count
           
static int YES
           
 
Constructor Summary
Display()
          #Display(String, int, int)
Display(Display.Name name)
          #Display(String, int, int)
Display(java.net.Socket socket, java.lang.String hostname, int display_no, int screen_no)
          Sets up a display using a connection over the specified socket.
Display(java.lang.String hostname, int display_no)
          #Display(String, int, int)
Display(java.lang.String hostname, int display_no, int screen_no)
           
 
Method Summary
 int allocate_id(java.lang.Object object)
           
 void bell(int percent)
          Rings the bell on the keyboard at a volume relative to the base volume of the keyboard, if possible.
 void change_hosts(int mode, int family, byte[] host)
           
 void check_error()
           
 void close()
           
 java.lang.String[] extensions()
          Returns a list of all extensions supported by the server.
 void flush()
           
 java.lang.String[] font_path()
          Returns the current search path for fonts.
 Data fonts_with_info(java.lang.String pattern, int max_name_count)
           
 Font[] fonts(java.lang.String pattern, int max_name_count)
           
 void force_screen_saver(int mode)
           
 void grab_server()
           
 void init_big_request_extension()
           
 void init_defaults()
           
 void kill_client(Resource resource)
           
 Display.HostsInfo list_hosts()
          Returns the hosts currently on the access control list and whether use of the list at connection setup is currently enabled or disabled.
 Event next_event()
           
 Display.ExtensionInfo query_extension(java.lang.String name)
          Determines if the named extension is present.
 Display.ScreenSaverInfo screen_saver()
          Returns the screensaver control values.
 Window selection_owner(Atom selection)
           
 void set_access_control(int mode)
           
 void set_close_down_mode(int mode)
           
 void set_font_path(int count, java.lang.String[] path)
           
 void set_screen_saver(int timeout, int interval, int prefer_blanking, int allow_exposures)
           
 java.lang.String toString()
           
 void ungrab_server()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CURRENT_TIME

public static final int CURRENT_TIME
See Also:
Constant Field Values

out

public RequestOutputStream out
The output stream.


in

public ResponseInputStream in
The input stream.


hostname

public java.lang.String hostname
The hostname to this display.


display_no

public int display_no
The display number.


input

public Input input

connected

public boolean connected
Indicates if this display is connected or not.


release_no

public int release_no

vendor

public java.lang.String vendor

maximum_request_length

public int maximum_request_length

screens

public Screen[] screens

pixmap_formats

public Pixmap.Format[] pixmap_formats

image_byte_order

public int image_byte_order

bitmap_format_bit_order

public int bitmap_format_bit_order

bitmap_format_scanline_unit

public int bitmap_format_scanline_unit

bitmap_format_scanline_pad

public int bitmap_format_scanline_pad

resource_base

public int resource_base

resource_mask

public int resource_mask

default_black

public Color default_black

default_white

public Color default_white

default_colormap

public Colormap default_colormap

default_depth

public int default_depth

default_pixmap_format

public Pixmap.Format default_pixmap_format

default_root

public Window default_root

default_screen

public Screen default_screen

default_screen_no

public int default_screen_no

default_gc

public GC default_gc
See Also:
Screen.default_gc()

resources

public java.util.Hashtable resources

resource_index

public int resource_index

atom_ids

public java.util.Hashtable atom_ids

atom_names

public java.util.Hashtable atom_names

xcmisc

public XCMisc xcmisc

use_xcmisc

public boolean use_xcmisc

xcmisc_resource_base

public int xcmisc_resource_base

xcmisc_resource_count

public int xcmisc_resource_count

big_requests_present

public boolean big_requests_present

extended_maximum_request_length

public int extended_maximum_request_length

extension_opcode_strings

public java.lang.String[] extension_opcode_strings
Major opcodes 128 through 255 are reserved for extensions, totally 128.


extension_minor_opcode_strings

public java.lang.String[][] extension_minor_opcode_strings

extension_event_factories

public EventFactory[] extension_event_factories
Event codes 64 through 127 are reserved for extensiones, totally 64.


extension_error_factories

public ErrorFactory[] extension_error_factories
Error codes 128 through 255 are reserved for extensiones, totally 128.


NO

public static final int NO
See Also:
Constant Field Values

YES

public static final int YES
See Also:
Constant Field Values

DEFAULT

public static final int DEFAULT
See Also:
Constant Field Values

SCREEN_SAVER_STRINGS

public static final java.lang.String[] SCREEN_SAVER_STRINGS

INSERT

public static final int INSERT
See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values

ENABLE

public static final int ENABLE
See Also:
Constant Field Values

DISABLE

public static final int DISABLE
See Also:
Constant Field Values

DESTROY

public static final int DESTROY
See Also:
Constant Field Values

RETAIN_PERMANENT

public static final int RETAIN_PERMANENT
See Also:
Constant Field Values

RETAIN_TEMPORARY

public static final int RETAIN_TEMPORARY
See Also:
Constant Field Values

ACTIVATE

public static final int ACTIVATE
See Also:
Constant Field Values

RESET

public static final int RESET
See Also:
Constant Field Values
Constructor Detail

Display

public Display()
#Display(String, int, int)


Display

public Display(Display.Name name)
#Display(String, int, int)


Display

public Display(java.lang.String hostname,
               int display_no)
#Display(String, int, int)


Display

public Display(java.net.Socket socket,
               java.lang.String hostname,
               int display_no,
               int screen_no)
Sets up a display using a connection over the specified socket. This should be used when there is a need to use non-TCP sockets, like connecting to an X server via Unix domain sockets. You need to provide an implementation for this kind of socket though.

Parameters:
socket - the socket to use for that connection
hostname - the hostname to connect to
display_no - the display number
screen_no - the screen number

Display

public Display(java.lang.String hostname,
               int display_no,
               int screen_no)
See Also:
XOpenDisplay
Method Detail

selection_owner

public Window selection_owner(Atom selection)
See Also:
XGetSelectionOwner

grab_server

public void grab_server()

ungrab_server

public void ungrab_server()

fonts

public Font[] fonts(java.lang.String pattern,
                    int max_name_count)
Returns:
valid: Enum#next() of type Font, Enum#next_string()
See Also:
XListFonts

fonts_with_info

public Data fonts_with_info(java.lang.String pattern,
                            int max_name_count)
See Also:
XListFontsWithInfo

set_font_path

public void set_font_path(int count,
                          java.lang.String[] path)
See Also:
XSetFontPath

font_path

public java.lang.String[] font_path()
Returns the current search path for fonts.

Returns:
the current search path for fonts
See Also:
set_font_path(int, String[]), XGetFontPath

query_extension

public Display.ExtensionInfo query_extension(java.lang.String name)
Determines if the named extension is present. If so, the major opcode for the extension is returned, if it has one. Otherwise zero is returned. Any minor opcode or the request formats are specific to the extension. If the extension involves additional event types, the base event type code is returned. Otherwise zero is returned. The format of the events is specific to the extension. If the extension involves additional error codes, the base error code is returned. The format of additional data in the errors is specific to the extension. The name should use ISO-Latin1 encoding, and uppercase and lowercase do matter.

Parameters:
name - the name of the extension to query
Returns:
See Also:
XQueryExtension

extensions

public java.lang.String[] extensions()
Returns a list of all extensions supported by the server.

Returns:
a list of all extensions supported by the server
See Also:
XListExtensions

bell

public void bell(int percent)
Rings the bell on the keyboard at a volume relative to the base volume of the keyboard, if possible. Percent can range from -100 to +100 inclusive (or a Value error results). The volume at which the bell is rung when percent is nonnegative is: base - [(base * percent) / 100] + percent When percent is negative, it is: base + [(base * percent) / 100]

Parameters:
volume, - see above
See Also:
XBell

set_screen_saver

public void set_screen_saver(int timeout,
                             int interval,
                             int prefer_blanking,
                             int allow_exposures)
Parameters:
prefer_blanking - valid: NO, YES, DEFAULT
allow_exposures - valid: NO, YES, DEFAULT
See Also:
XSetScreenSaver

screen_saver

public Display.ScreenSaverInfo screen_saver()
Returns the screensaver control values.

Returns:
the screensaver control values
See Also:
XGetScreenSaver

change_hosts

public void change_hosts(int mode,
                         int family,
                         byte[] host)
Parameters:
mode - valid: INSERT, DELETE
See Also:
XAddHost, XRemoveHost

list_hosts

public Display.HostsInfo list_hosts()
Returns the hosts currently on the access control list and whether use of the list at connection setup is currently enabled or disabled.

See Also:
XListHosts

set_access_control

public void set_access_control(int mode)
Parameters:
mode - valid: ENABLE, DISABLE
See Also:
XSetAccessControl

kill_client

public void kill_client(Resource resource)
See Also:
XKillClient

set_close_down_mode

public void set_close_down_mode(int mode)
Parameters:
mode - valid: DESTROY, RETAIN_PERMANENT, RETAIN_TEMPORARY
See Also:
XSetCloseDownMode

force_screen_saver

public void force_screen_saver(int mode)
Parameters:
mode - valid: ACTIVATE, RESET
See Also:
XForceScreenSaver

allocate_id

public int allocate_id(java.lang.Object object)

close

public void close()
See Also:
XCloseDisplay

init_big_request_extension

public void init_big_request_extension()

init_defaults

public void init_defaults()

next_event

public Event next_event()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

check_error

public void check_error()

flush

public void flush()