org.gnu.gdk

Class Display


public class Display
extends GObject

Controls the keyboard/mouse pointer grabs and a set of Screens.

Field Summary

Fields inherited from class org.gnu.glib.GObject

eventsInitialized

Constructor Summary

Display()
Creates the default Display.
Display(Handle hndl)

Method Summary

void
beep()
Emits a short beep on display.
void
close()
Closes the connection to the windowing system for this display and cleans up associated resources.
void
flush()
Flushes any requests queued for the windowing system; this happens automatically when the main loop block waiting for events, but if your application is drawing without returning control to the main loop, you may need to call this method explicitely.
protected static void
gdk_display_beep(Handle display)
protected static void
gdk_display_close(Handle display)
protected static void
gdk_display_flush(Handle display)
protected static Handle
gdk_display_get_core_pointer(Handle display)
protected static Handle
gdk_display_get_default()
protected static int
gdk_display_get_default_cursor_size(Handle display)
protected static Handle
gdk_display_get_default_group(Handle display)
protected static Handle
gdk_display_get_default_screen(Handle display)
protected static Handle
gdk_display_get_event(Handle display)
protected static void
gdk_display_get_maximum_cursor_size(Handle display, int[] width, int[] height)
protected static int
gdk_display_get_n_screens(Handle display)
protected static String
gdk_display_get_name(Handle display)
protected static void
gdk_display_get_pointer(Handle display, Handle screen, int[] x, int[] y, int[] modType)
protected static Handle
gdk_display_get_screen(Handle display, int screenNum)
protected static int
gdk_display_get_type()
protected static Handle
gdk_display_get_window_at_pointer(Handle display, int x, int y)
protected static void
gdk_display_keyboard_ungrab(Handle display, int time)
protected static Handle[]
gdk_display_list_devices(Handle display)
protected static Handle
gdk_display_open(String displayName)
protected static Handle
gdk_display_peek_event(Handle display)
protected static boolean
gdk_display_pointer_is_grabbed(Handle display)
protected static void
gdk_display_pointer_ungrab(Handle display, int time)
protected static void
gdk_display_put_event(Handle display, Handle event)
protected static boolean
gdk_display_request_selection_notification(Handle display, Handle selection)
protected static void
gdk_display_store_clipboard(Handle display, Handle clipboardWindow, int time, Handle[] targets)
protected static boolean
gdk_display_supports_clipboard_persistence(Handle display)
protected static boolean
gdk_display_supports_cursor_alpha(Handle display)
protected static boolean
gdk_display_supports_cursor_color(Handle display)
protected static boolean
gdk_display_supports_selection_notification(Handle display)
protected static void
gdk_display_sync(Handle display)
Device
getCorePointer()
int
getDefaultCursorSize()
Returns the default size to use for cursors on display.
Window
getDefaultGroup()
Returns the default group leader window for all toplevel windows on display.
Screen
getDefaultScreen()
Gets the default Screen for display.
Event
getEvent()
Gets the next event to be processed by the display, fetching events from the windowing system if necessary.
int
getMaxCursorHeight()
Return the maximum height for a cursor on display.
int
getMaxCursorWidth()
Return the maximum width for a cursor on display.
String
getName()
Gets the name of the Display.
int
getNumScreens()
Gets the number of Screens managed by the Display.
Point
getPointerLocation()
Returns the point where the pointer is currently pointing.
Screen
getPointerScreen()
Returns the screen that the pointer is on.
Screen
getScreen(int screenNumber)
Gets the a Screen object for one of the screens of the display.
Window
getWindowAtPointer()
Obtains the window underneath the mouse pointer.
Device[]
listDevice()
Returns an array of available input devices attached to this display.
static Display
open(String name)
Opens a Display.
Event
peekEvent()
Gets a copy of the first event in the display's event queue without removing the event from the queue.
boolean
pointerIsGrabbed()
Tests if the pointer is grabbed.
void
putEvent(Event anEvent)
Appends a copy of a given event onto the front of the event queue for the display.
boolean
requestSelectionNotification(Atom atom)
Requests EventOwnerChange events for ownership changes of the selection named by the given atom.
void
storeClipboard(Window clipboardWindow, Atom[] targets)
Issues a request to the clipboard manager to store the clipboard data.
boolean
supportsClipboardPersistence()
Returns whether the display supports clipboard persistence; i.e.
boolean
supportsCursorAlpha()
Returns true if the cursor can use an 8bit alpha channel on display.
boolean
supportsCursorColor()
Returns true if multicolored cursors are supported on the display.
boolean
supportsSelectionNotification()
Returns whether EventOwnerChange events will be sent when the owner of a selection changes.
void
sync()
Flushes any requests queued for the windowing system and waits until all requests are handled.
void
ungrabKeyboard()
Releases any keyboard grab.
void
ungrabPointer()
Releases any pointer grab.

Methods inherited from class org.gnu.glib.GObject

addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, equals, freezeNotify, getBooleanProperty, getData, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getNullHandle, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hasProperty, hashCode, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setHandle, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify

Constructor Details

Display

public Display()
Creates the default Display.


Display

public Display(Handle hndl)

Method Details

beep

public void beep()
Emits a short beep on display.


close

public void close()
Closes the connection to the windowing system for this display and cleans up associated resources.


flush

public void flush()
Flushes any requests queued for the windowing system; this happens automatically when the main loop block waiting for events, but if your application is drawing without returning control to the main loop, you may need to call this method explicitely. A common case where this method needs to be called is when an application is executing drawing commands from a thread other than the thread where the main loop is running.


gdk_display_beep

protected static final void gdk_display_beep(Handle display)


gdk_display_close

protected static final void gdk_display_close(Handle display)


gdk_display_flush

protected static final void gdk_display_flush(Handle display)


gdk_display_get_core_pointer

protected static final Handle gdk_display_get_core_pointer(Handle display)


gdk_display_get_default

protected static final Handle gdk_display_get_default()


gdk_display_get_default_cursor_size

protected static final int gdk_display_get_default_cursor_size(Handle display)


gdk_display_get_default_group

protected static final Handle gdk_display_get_default_group(Handle display)


gdk_display_get_default_screen

protected static final Handle gdk_display_get_default_screen(Handle display)


gdk_display_get_event

protected static final Handle gdk_display_get_event(Handle display)


gdk_display_get_maximum_cursor_size

protected static final void gdk_display_get_maximum_cursor_size(Handle display,
                                                                int[] width,
                                                                int[] height)


gdk_display_get_n_screens

protected static final int gdk_display_get_n_screens(Handle display)


gdk_display_get_name

protected static final String gdk_display_get_name(Handle display)


gdk_display_get_pointer

protected static final void gdk_display_get_pointer(Handle display,
                                                    Handle screen,
                                                    int[] x,
                                                    int[] y,
                                                    int[] modType)


gdk_display_get_screen

protected static final Handle gdk_display_get_screen(Handle display,
                                                     int screenNum)


gdk_display_get_type

protected static final int gdk_display_get_type()


gdk_display_get_window_at_pointer

protected static final Handle gdk_display_get_window_at_pointer(Handle display,
                                                                int x,
                                                                int y)


gdk_display_keyboard_ungrab

protected static final void gdk_display_keyboard_ungrab(Handle display,
                                                        int time)


gdk_display_list_devices

protected static final Handle[] gdk_display_list_devices(Handle display)


gdk_display_open

protected static final Handle gdk_display_open(String displayName)


gdk_display_peek_event

protected static final Handle gdk_display_peek_event(Handle display)


gdk_display_pointer_is_grabbed

protected static final boolean gdk_display_pointer_is_grabbed(Handle display)


gdk_display_pointer_ungrab

protected static final void gdk_display_pointer_ungrab(Handle display,
                                                       int time)


gdk_display_put_event

protected static final void gdk_display_put_event(Handle display,
                                                  Handle event)


gdk_display_request_selection_notification

protected static final boolean gdk_display_request_selection_notification(Handle display,
                                                                          Handle selection)


gdk_display_store_clipboard

protected static final void gdk_display_store_clipboard(Handle display,
                                                        Handle clipboardWindow,
                                                        int time,
                                                        Handle[] targets)


gdk_display_supports_clipboard_persistence

protected static final boolean gdk_display_supports_clipboard_persistence(Handle display)


gdk_display_supports_cursor_alpha

protected static final boolean gdk_display_supports_cursor_alpha(Handle display)


gdk_display_supports_cursor_color

protected static final boolean gdk_display_supports_cursor_color(Handle display)


gdk_display_supports_selection_notification

protected static final boolean gdk_display_supports_selection_notification(Handle display)


gdk_display_sync

protected static final void gdk_display_sync(Handle display)


getCorePointer

public Device getCorePointer()


getDefaultCursorSize

public int getDefaultCursorSize()
Returns the default size to use for cursors on display.


getDefaultGroup

public Window getDefaultGroup()
Returns the default group leader window for all toplevel windows on display.


getDefaultScreen

public Screen getDefaultScreen()
Gets the default Screen for display.


getEvent

public Event getEvent()
Gets the next event to be processed by the display, fetching events from the windowing system if necessary.


getMaxCursorHeight

public int getMaxCursorHeight()
Return the maximum height for a cursor on display.


getMaxCursorWidth

public int getMaxCursorWidth()
Return the maximum width for a cursor on display.


getName

public String getName()
Gets the name of the Display.


getNumScreens

public int getNumScreens()
Gets the number of Screens managed by the Display.


getPointerLocation

public Point getPointerLocation()
Returns the point where the pointer is currently pointing.


getPointerScreen

public Screen getPointerScreen()
Returns the screen that the pointer is on.


getScreen

public Screen getScreen(int screenNumber)
Gets the a Screen object for one of the screens of the display.

Parameters:
screenNumber -


getWindowAtPointer

public Window getWindowAtPointer()
Obtains the window underneath the mouse pointer.


listDevice

public Device[] listDevice()
Returns an array of available input devices attached to this display.


open

public static Display open(String name)
Opens a Display.

Parameters:
name -


peekEvent

public Event peekEvent()
Gets a copy of the first event in the display's event queue without removing the event from the queue.


pointerIsGrabbed

public boolean pointerIsGrabbed()
Tests if the pointer is grabbed.


putEvent

public void putEvent(Event anEvent)
Appends a copy of a given event onto the front of the event queue for the display.

Parameters:
anEvent -


requestSelectionNotification

public boolean requestSelectionNotification(Atom atom)
Requests EventOwnerChange events for ownership changes of the selection named by the given atom.

Parameters:
atom -


storeClipboard

public void storeClipboard(Window clipboardWindow,
                           Atom[] targets)
Issues a request to the clipboard manager to store the clipboard data.

Parameters:
clipboardWindow -
targets -


supportsClipboardPersistence

public boolean supportsClipboardPersistence()
Returns whether the display supports clipboard persistence; i.e. if it is possible to store the clipboard data after an application has quit.


supportsCursorAlpha

public boolean supportsCursorAlpha()
Returns true if the cursor can use an 8bit alpha channel on display.


supportsCursorColor

public boolean supportsCursorColor()
Returns true if multicolored cursors are supported on the display.


supportsSelectionNotification

public boolean supportsSelectionNotification()
Returns whether EventOwnerChange events will be sent when the owner of a selection changes.


sync

public void sync()
Flushes any requests queued for the windowing system and waits until all requests are handled. This is often used for making sure that the display is synchronized with the current state of the program.


ungrabKeyboard

public void ungrabKeyboard()
Releases any keyboard grab.


ungrabPointer

public void ungrabPointer()
Releases any pointer grab.