org.gnu.gdk
public class Window extends Drawable
Constructor Summary | |
---|---|
Window(Handle handle) | |
Window(Window parent, WindowAttr attributes, int attributesMask) |
Method Summary | |
---|---|
void | beginPaintRectangle(Rectangle rec)
Indicates that you are beginning the process of redrawing rec. |
void | beginPaintRegion(Region region)
Indicates that you are beginning the process of redrawing region. |
void | clear()
Clears an entire window to the background color or
background pixmap. |
void | clearArea(int x, int y, int width, int height, boolean exposeEvent) |
void | deiconify()
Asks to deiconify (ie unminimize) the specified window. |
void | destroy() |
void | endPaint()
Indicates that the backing store created by the most recent call to
beginPaintRegion() should be copied onscreen and deleted, leaving the
next-most-recent backing store or no backing store at all as the active
paint region. |
Window[] | getChildren()
Gets the list of children of window known to GDK. |
EventMask | getEvents()
Gets the event mask for window.
|
Rectangle | getFrameExtents()
Obtains the bounding box of the window, including window manager
titlebar/borders if any. |
int | getHeight()
Retrieve the current height of the Window.
|
void | getKeyboardFocus() |
Point | getOrigin()
Obtains the position of a window in root window coordinates. |
Window | getParent()
Obtains the parent of window, as known to GDK. |
Point | getPointerLocation() |
ModifierType | getPointerModifierType() |
Window | getPointerWindow() |
Point | getPosition()
Obtains the position of the window as reported in the
most-recently-processed EventConfigure. |
Point | getRootOrigin()
Obtains the top-left corner of the window manager frame in root window
coordinates. |
Window | getToplevel()
Gets the toplevel window that's an ancestor of this window. |
static Window[] | getTopLevelWindows() |
static Type | getType()
Retrieve the runtime type used by the GLib library. |
int | getWidth()
Retrieve the current width of the Window.
|
Window | getWindowAt(int x, int y)
Obtains the window underneath the mouse pointer. |
Window | getWindowAtPointer()
Obtains the window underneath the mouse pointer. |
static Window | getWindowFromHandle(Handle hndl)
Only to be used internally by Java-Gnome. |
WindowState | getWindowState() |
GrabStatus | grabKeyboard(boolean ownerEvents, int time)
Grabs the keyboard so that all events are passed to this application
until the keyboard is ungrabbed with ungrabKeyboard. |
GrabStatus | grabPointer(boolean ownerEvents, EventMask eventMask, Window confineTo, Cursor cursor, int time)
Grabs the pointer (usually a mouse) so that all events are passed to this
application until the pointer is ungrabbed with ungrabPointer, or the
grab window becomes unviewable. |
void | hide()
For toplevel windows, withdraws them, so they will no longer be known to
the window manager; for all windows, unmaps them, so they won't be
displayed. |
void | iconify()
Asks to iconify (ie minimize) the specified window. |
void | invalidateRect(Rectangle rect, boolean invalidateChildren)
Invalidates a rectangular region of the window's content. |
void | invalidateRegion(Region region, boolean invalidateChildren)
Invalidates a region of the window's content. |
boolean | isViewable() |
boolean | isVisible() |
void | lower() |
void | maximize()
Asks to maximize window, so that it becomes full-screen. |
void | mergeChildShapes() |
void | move(int x, int y)
Repositions a window relative to its parent window. |
void | moveAndResize(int x, int y, int width, int height)
Equivalent to calling move() and resize() ,
except that both operations are performed at once, avoiding strange
visual effects (ie the user may be able to see the window first move,
then resize, if you don't use moveAndResize() ).
|
boolean | pointerIsGrabbed()
Returns true if the pointer is currently grabbed by this application. |
void | raise() |
void | reparent(Window parent, int x, int y)
Reparents window into the given parent . |
void | resize(int width, int height)
Resizes window; for toplevel windows, asks the window manager to resize
the window. |
void | scrollContent(int x, int y) |
void | setBackground(Color color)
Sets the background color of a window.
|
void | setBackground(Pixmap pixmap, boolean parentRelative)
Sets the background pixmap of window. |
void | setBitmapMask(Bitmap mask, int x, int y) |
void | setChildMask(boolean masked) |
void | setCursor(Cursor cursor)
Sets the mouse pointer for a Window.
|
void | setEvents(EventMask mask)
The event mask for a window determines which events will be reported for
that window. |
void | setGeometryHints(Geometry geometry, WindowHints hints)
Sets the geometry hints for a window.
|
void | setHint(WindowTypeHint hint) |
void | setIcon(Window icon, Pixmap pixmap, Bitmap mask)
Sets up the icon representing a Window. |
void | setIconList(Pixbuf[] icons)
Sets up the icon representing a Window. |
void | setIconName(String name)
Sets the icon for the window from a named themed icon. |
void | setModalHint(boolean modal)
The application can use this hint to tell the window manager that a
certain window has modal behavior. |
void | setRegionMask(Region region, int x, int y) |
void | setRole(String role)
The window manager and session manager use a window's role to distinguish
it from other kinds of window in the same application. |
boolean | setStaticGravities(boolean useStatic)
Set the bit gravity of the given window to static, and flag it so all
children get static subwindow gravity. |
void | setTitle(String title)
Sets the title of a toplevel window, to be displayed in the titlebar. |
void | setTransientOf(Window parent)
Indicates to the window manager that the window is a transient dialog
associated with the application window parent. |
void | setUnmanaged(boolean unmanaged) |
void | show()
Raises the window to the top of the window stack (moves
the window to the front of the Z-order). |
void | showUnraised()
Shows a GdkWindow onscreen, but does not modify its
stacking order. |
void | stick()
Asks to stick window, which means that it will appear on all user
desktops. |
void | ungrabKeyboard(int time)
Ungrabs the keyboard, if it is grabbed by this application.
|
void | ungrabPointer(int time)
Ungrabs the pointer, if it is grabbed by this application.
|
void | unmaximize()
Asks to unmaximize window. |
void | unstick()
Asks to unstick window, which means that it will appear on only one of
the user's desktops. |
void | withdraw()
Withdraws a window (unmaps it and asks the window manager to forget about
it). |
Parameters: rec
Parameters: region
window
to the background color or
background pixmap.Returns: the event mask of the window.
See Also: setEvents
Returns: The height of the Window.
Returns: The width of the Window.
Deprecated: This method is incorrect and is deprecated in favor of {@link #getWindowAtPointer()}.
Obtains the window underneath the mouse pointer. Returs NULL if the window under the mouse pointer is not known to GDK (for example, belongs to another application).Parameters: x X position of the window. y Y position of the window.
Returns: The window underneath the mouse pointer.
Returns: The window underneath the mouse pointer.
Parameters: ownerEvents if false then all keyboard events are reported with respect to window. If true then keyboard events for this application are reported as normal, but keyboard events outside this application are reported with respect to window. Both key press and key release events are always reported, independant of the event mask set by the application. time
Pointer grabs are used for operations which need complete control over mouse events, even if the mouse leaves the application. For example in GTK+ it is used for Drag and Drop, for dragging the handle in the HPaned and VPaned widgets, and for resizing columns in CList widgets.
Note that if the event mask of an X window has selected both button press and button release events, then a button press event will cause an automatic pointer grab until the button is released. X does this automatically since most applications expect to receive button press and release events in pairs. It is equivalent to a pointer grab on the window with ownerEvents set to true.
Parameters: ownerEvents if false then all pointer events are reported with respect to window and are only reported if selected by event_mask. If true then pointer events for this application are reported as normal, but pointer events outside this application are reported with respect to window and only if selected by event_mask. In either mode, unreported events are discarded. eventMask specifies the event mask, which is used in accordance with ownerEvents. Note that only pointer events (i.e. button and motion events) may be selected. confineTo If non-null, the pointer will be confined to this window during the grab. If the pointer is outside confineTo, it will automatically be moved to the closest edge of confineTo and enter and leave events will be generated as necessary. cursor the cursor to display while the grab is active. If this is null then the normal cursors are used for window and its descendants, and the cursor for window is used for all other windows. time the timestamp of the event which led to this pointer grab. This usually comes from a EventButton, though CURRENT_TIME can be used if the time isn't known.
Parameters: x new x position. y new y position.
move()
and resize()
,
except that both operations are performed at once, avoiding strange
visual effects (ie the user may be able to see the window first move,
then resize, if you don't use moveAndResize()
).
Parameters: x the new x position. y the new y position. width the new width. height the new height.
parent
. The window being
reparented will be unmapped as a side effect.
Parameters: parent the new parent to move window into. x X location inside the new parent. y Y location inside the new parent.
Parameters: width the new window width. height the new window height.
Parameters: color
Parameters: pixmap parentRelative
Parameters: cursor
Parameters: mask the new event mask.
Parameters: geometry hints
The icon should be provided in whatever size it was naturally drawn; that is, don't scale the image before passing it. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.
If you have your icon hand-drawn in multiple sizes, use setIconList(). Then the best size will be used.
Parameters: icon pixmap mask
This method allows you to pass in the same icon in several hand-drawn sizes. The list should contain the natural sizes your icon is available in; that is, don't scale the image before passing it. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.
By passing several sizes, you may improve the final image quality of the icon, by reducing or eliminating automatic image scaling.
Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and larger images (64x64, 128x128) if you have them.
Parameters: icons
Parameters: name
Parameters: modal
Parameters: role
Parameters: useStatic
Returns: true if the server supports static gravity.
Parameters: title
Parameters: parent
window
to the top of the window stack (moves
the window to the front of the Z-order).GdkWindow
onscreen, but does not modify its
stacking order. In contrast, show()
will raise the window
to the top of the window stack.Parameters: time
Parameters: time