beginPaintRectangle
public void beginPaintRectangle(Rectangle rec)
Indicates that you are beginning the process of redrawing rec.
A backing store (offscreen buffer) large enough to contain rectangle will
be created. The backing store will be initialized with the background
color or background pixmap for window. Then, all drawing operations
performed on window will be diverted to the backing store. When you
call endPaint(), the backing store will be copied to window, making
it visible onscreen. Only the part of window contained in region will
be modified; that is, drawing operations are clipped to rectangle.
rec
-
beginPaintRegion
public void beginPaintRegion(Region region)
Indicates that you are beginning the process of redrawing region.
A backing store (offscreen buffer) large enough to contain region will
be created. The backing store will be initialized with the background
color or background pixmap for window. Then, all drawing operations
performed on window will be diverted to the backing store. When you
call endPaint(), the backing store will be copied to window, making
it visible onscreen. Only the part of window contained in region will
be modified; that is, drawing operations are clipped to region.
region
-
clear
public void clear()
Clears an entire window
to the background color or background pixmap.
clearArea
public void clearArea(int x,
int y,
int width,
int height,
boolean exposeEvent)
deiconify
public void deiconify()
Asks to deiconify (ie unminimize) the specified window. Note
that you shouldn't assume the window is definitely deiconified
afterward, because other entities (e.g. the user or window
manager) could iconify it again before your code which assumes
deiconification gets to run.
destroy
public void destroy()
endPaint
public 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. See beginPaintRegion() for full details. It is
an error to call this function without a matching beginPaintRegion()
first.
gdk_window_at_pointer
protected static final Handle gdk_window_at_pointer(int winX,
int winY)
gdk_window_begin_move_drag
protected static final void gdk_window_begin_move_drag(Handle window,
int button,
int rootX,
int rootY,
int timestamp)
gdk_window_begin_paint_rect
protected static final void gdk_window_begin_paint_rect(Handle window,
Handle rectangle)
gdk_window_begin_paint_region
protected static final void gdk_window_begin_paint_region(Handle window,
Handle region)
gdk_window_begin_resize_drag
protected static final void gdk_window_begin_resize_drag(Handle window,
int edge,
int button,
int rootX,
int rootY,
int timestamp)
gdk_window_clear
protected static final void gdk_window_clear(Handle window)
gdk_window_clear_area
protected static final void gdk_window_clear_area(Handle window,
int x,
int y,
int width,
int height)
gdk_window_clear_area_e
protected static final void gdk_window_clear_area_e(Handle window,
int x,
int y,
int width,
int height)
gdk_window_constrain_size
protected static final void gdk_window_constrain_size(int geometry,
int flags,
int width,
int height,
int[] newWidth,
int[] newHeight)
gdk_window_deiconify
protected static final void gdk_window_deiconify(Handle window)
gdk_window_destroy
protected static final void gdk_window_destroy(Handle window)
gdk_window_end_paint
protected static final void gdk_window_end_paint(Handle window)
gdk_window_focus
protected static final void gdk_window_focus(Handle window)
gdk_window_foreign_new
protected static final int gdk_window_foreign_new(int anid)
gdk_window_freeze_updates
protected static final void gdk_window_freeze_updates(Handle window)
gdk_window_get_children
protected static final Handle[] gdk_window_get_children(Handle window)
gdk_window_get_events
protected static final int gdk_window_get_events(Handle window)
gdk_window_get_frame_extents
protected static final void gdk_window_get_frame_extents(Handle window,
Handle rect)
gdk_window_get_geometry
protected static final void gdk_window_get_geometry(Handle window,
int[] x,
int[] y,
int[] width,
int[] height,
int[] depth)
gdk_window_get_internal_paint_info
protected static final void gdk_window_get_internal_paint_info(Handle window,
Handle realDrawable,
int[] xOffset,
int[] yOffset)
gdk_window_get_origin
protected static final int gdk_window_get_origin(Handle window,
int[] x,
int[] y)
gdk_window_get_parent
protected static final Handle gdk_window_get_parent(Handle window)
gdk_window_get_position
protected static final void gdk_window_get_position(Handle window,
int[] x,
int[] y)
gdk_window_get_root_origin
protected static final void gdk_window_get_root_origin(Handle window,
int[] x,
int[] y)
gdk_window_get_state
protected static final int gdk_window_get_state(Handle window)
gdk_window_get_toplevel
protected static final Handle gdk_window_get_toplevel(Handle window)
gdk_window_get_toplevels
protected static final Handle gdk_window_get_toplevels()
gdk_window_get_update_area
protected static final int gdk_window_get_update_area(Handle window)
gdk_window_get_window_type
protected static final int gdk_window_get_window_type(Handle window)
gdk_window_hide
protected static final void gdk_window_hide(Handle window)
gdk_window_iconify
protected static final void gdk_window_iconify(Handle window)
gdk_window_invalidate_rect
protected static final void gdk_window_invalidate_rect(Handle window,
Handle rect,
boolean invalidateChildren)
gdk_window_invalidate_region
protected static final void gdk_window_invalidate_region(Handle window,
Handle region,
boolean invalidateChildren)
gdk_window_is_viewable
protected static final boolean gdk_window_is_viewable(Handle window)
gdk_window_is_visible
protected static final boolean gdk_window_is_visible(Handle window)
gdk_window_lower
protected static final void gdk_window_lower(Handle window)
gdk_window_maximize
protected static final void gdk_window_maximize(Handle window)
gdk_window_merge_child_shapes
protected static final void gdk_window_merge_child_shapes(Handle window)
gdk_window_move
protected static final void gdk_window_move(Handle window,
int x,
int y)
gdk_window_move_resize
protected static final void gdk_window_move_resize(Handle window,
int x,
int y,
int width,
int height)
gdk_window_new
protected static final Handle gdk_window_new(Handle parent,
Handle attriutes,
int attributesMask)
gdk_window_peek_children
protected static final Handle[] gdk_window_peek_children(Handle window)
gdk_window_process_all_updates
protected static final void gdk_window_process_all_updates()
gdk_window_process_updates
protected static final void gdk_window_process_updates(Handle window,
boolean updateChildren)
gdk_window_raise
protected static final void gdk_window_raise(Handle window)
gdk_window_register_dnd
protected static final void gdk_window_register_dnd(Handle window)
gdk_window_reparent
protected static final void gdk_window_reparent(Handle window,
Handle newParent,
int x,
int y)
gdk_window_resize
protected static final void gdk_window_resize(Handle window,
int width,
int height)
gdk_window_scroll
protected static final void gdk_window_scroll(Handle window,
int dx,
int dy)
gdk_window_set_back_pixmap
protected static final void gdk_window_set_back_pixmap(Handle window,
Handle pixmap,
boolean parentRelative)
gdk_window_set_background
protected static final void gdk_window_set_background(Handle window,
Handle color)
gdk_window_set_child_shapes
protected static final void gdk_window_set_child_shapes(Handle window)
gdk_window_set_cursor
protected static final void gdk_window_set_cursor(Handle window,
Handle cursor)
gdk_window_set_debug_updates
protected static final void gdk_window_set_debug_updates(boolean setting)
gdk_window_set_decorations
protected static final void gdk_window_set_decorations(Handle window,
int decorations)
gdk_window_set_events
protected static final void gdk_window_set_events(Handle window,
int eventMask)
gdk_window_set_functions
protected static final void gdk_window_set_functions(Handle window,
int functions)
gdk_window_set_geometry_hints
protected static final void gdk_window_set_geometry_hints(Handle window,
Handle geometry,
int flags)
gdk_window_set_group
protected static final void gdk_window_set_group(Handle window,
Handle leader)
gdk_window_set_icon
protected static final void gdk_window_set_icon(Handle window,
Handle iconWindow,
Handle pixmap,
Handle mask)
gdk_window_set_icon_list
protected static final void gdk_window_set_icon_list(Handle window,
Handle[] pixbufs)
gdk_window_set_icon_name
protected static final void gdk_window_set_icon_name(Handle window,
String name)
gdk_window_set_modal_hint
protected static final void gdk_window_set_modal_hint(Handle window,
boolean modal)
gdk_window_set_override_redirect
protected static final void gdk_window_set_override_redirect(Handle window,
boolean overrideRedirect)
gdk_window_set_role
protected static final void gdk_window_set_role(Handle window,
String role)
gdk_window_set_static_gravities
protected static final boolean gdk_window_set_static_gravities(Handle window,
boolean useStatic)
gdk_window_set_title
protected static final void gdk_window_set_title(Handle window,
String title)
gdk_window_set_transient_for
protected static final void gdk_window_set_transient_for(Handle window,
Handle leader)
gdk_window_set_type_hint
protected static final void gdk_window_set_type_hint(Handle window,
int hint)
gdk_window_set_user_data
protected static final void gdk_window_set_user_data(Handle window,
Object userData)
gdk_window_shape_combine_mask
protected static final void gdk_window_shape_combine_mask(Handle window,
Handle shape_mask,
int offsetX,
int offsetY)
gdk_window_shape_combine_region
protected static final void gdk_window_shape_combine_region(Handle window,
Handle shape_region,
int offsetX,
int offsetY)
gdk_window_show
protected static final void gdk_window_show(Handle window)
gdk_window_show_unraised
protected static final void gdk_window_show_unraised(Handle window)
gdk_window_stick
protected static final void gdk_window_stick(Handle window)
gdk_window_thaw_updates
protected static final void gdk_window_thaw_updates(Handle window)
gdk_window_unmaximize
protected static final void gdk_window_unmaximize(Handle window)
gdk_window_unstick
protected static final void gdk_window_unstick(Handle window)
gdk_window_withdraw
protected static final void gdk_window_withdraw(Handle window)
getChildren
public Window[] getChildren()
Gets the list of children of window known to GDK. This function
only returns children created via GDK, so for example it's useless
when used with the root window; it only returns windows an application
created itself.
getFrameExtents
public Rectangle getFrameExtents()
Obtains the bounding box of the window, including window manager
titlebar/borders if any. The frame position is given in root window
coordinates. To get the position of the window itself (rather than
the frame) in root window coordinates, use getOrigin().
getHeight
public int getHeight()
Retrieve the current height of the Window.
- The height of the Window.
getKeyboardFocus
public void getKeyboardFocus()
getOrigin
public Point getOrigin()
Obtains the position of a window in root window coordinates.
(Compare with getPosition() and getGeometry() which return the position
of a window relative to its parent window.)
getParent
public Window getParent()
Obtains the parent of window, as known to GDK. Does not query the X
server; thus this returns the parent as passed to the constructor,
not the actual parent.
getPosition
public Point getPosition()
Obtains the position of the window as reported in the
most-recently-processed EventConfigure. Contrast with
getGeometry() which queries the X server for the current window
position, regardless of which events have been received or processed.
getRootOrigin
public Point getRootOrigin()
Obtains the top-left corner of the window manager frame in root
window coordinates.
getTopLevelWindows
public static Window[] getTopLevelWindows()
getToplevel
public Window getToplevel()
Gets the toplevel window that's an ancestor of this window.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
- getType in interface Drawable
getWidth
public int getWidth()
Retrieve the current width of the Window.
- The width of the Window.
getWindowAt
public Window getWindowAt(int x,
int y)
Obtains the window underneath the mouse pointer, returning the location of that window in win_x, win_y.
Returns NULL if the window under the mouse pointer is not known to GDK (for example, belongs to another application).
x
- X position of the window.y
- Y position of the window.
- The window at the specified location.
hide
public 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.
iconify
public void iconify()
Asks to iconify (ie minimize) the specified window. Note that you
shouldn't assume the window is definitely iconified afterward, because
other entities (e.g. the user or window manager) could deiconify it
again, or there may not be a window manager in which case iconification
isn't possible, etc. But normally the window will end up iconified. Just
don't write code that crashes if not.
isViewable
public boolean isViewable()
isVisible
public boolean isVisible()
maximize
public void maximize()
Asks to maximize window, so that it becomes full-screen.
mergeChildShapes
public void mergeChildShapes()
move
public void move(int x,
int y)
Repositions a window relative to its parent window. For toplevel windows,
window managers may ignore or modify the move; For child windows, the move will reliably succeed.
x
- new x position.y
- new y position.
moveAndResize
public 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()
).
x
- the new x position.y
- the new y position.width
- the new width.height
- the new height.
reparent
public void reparent(Window parent,
int x,
int y)
Reparents window into the given parent
.
The window being reparented will be unmapped as a side effect.
parent
- the new parent to move window into.x
- X location inside the new parent.y
- Y location inside the new parent.
resize
public void resize(int width,
int height)
Resizes window; for toplevel windows, asks the window manager to resize the window.
The window manager may not allow the resize. Windows may not be resized below 1x1.
width
- the new window width.height
- the new window height.
scrollContent
public void scrollContent(int x,
int y)
setBackground
public void setBackground(Color color)
Sets the background color of a window.
color
-
setBackground
public void setBackground(Pixmap pixmap,
boolean parentRelative)
Sets the background pixmap of window. May also be used to set a
background of "None" on window, by setting a background pixmap of
null. A background pixmap will be tiled, positioning the first tile
at the origin of window, or if parent_relative is true, the tiling
will be done based on the origin of the parent window (useful to
align tiles in a parent with tiles in a child).
pixmap
- parentRelative
-
setBitmapMask
public void setBitmapMask(Bitmap mask,
int x,
int y)
setChildMask
public void setChildMask(boolean masked)
setCursor
public void setCursor(Cursor cursor)
Sets the mouse pointer for a Window.
cursor
-
setEvents
public void setEvents(EventMask mask)
The event mask for a window determines which events will be
reported for that window. For example, an event mask
including BUTTON_PRESS_MASK means the window should report
button press events. The event mask is the bitwise OR of
values from the EventMask enumeration.
mask
- the new event mask.
setGeometryHints
public void setGeometryHints(Geometry geometry,
WindowHints hints)
Sets the geometry hints for a window.
geometry
- hints
-
setIcon
public void setIcon(Window icon,
Pixmap pixmap,
Bitmap mask)
Sets up the icon representing a Window. This icon is used when
the window is minimized (also known as iconified). Some window
managers or desktop environments may also place it in the window
frame, or display it in other contexts.
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.
icon
- pixmap
- mask
-
setIconList
public void setIconList(Pixbuf[] icons)
Sets up the icon representing a Window. The icon is used when the
window is minimized (also known as iconified). Some window managers
or desktop environments may also place it in the window frame, or
display it in other contexts.
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.
icons
-
setIconName
public void setIconName(String name)
Sets the icon for the window from a named themed icon. See the docs for
IconTheme
for more details.
name
-
setModalHint
public void setModalHint(boolean modal)
The application can use this hint to tell the window manager that
a certain window has modal behavior. The window manager can use this
information to handle modal windows in certain ways.
modal
-
setRegionMask
public void setRegionMask(Region region,
int x,
int y)
setRole
public 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.
When an application is restarted after being saved in a previous
session, all windows with the same title and role are treated as
interchangeable. So if you have two windows with the same title
that should be distinguished for session management purposes, you
should set the role on those windows. It doesn't matter what string
you use for the role, as long as you have a different role for each
non-interchangeable kind of window
role
-
setStaticGravities
public boolean setStaticGravities(boolean useStatic)
Set the bit gravity of the given window to static, and flag it so
all children get static subwindow gravity. This is used if you are
implementing scary features that involve deep knowledge of the
windowing system. Don't worry about it unless you have to.
useStatic
-
- true if the server supports static gravity.
setTitle
public void setTitle(String title)
Sets the title of a toplevel window, to be displayed in the titlebar.
If you haven't explicitly set the icon name for the window (using
setIconName()), the icon name will be set to title as well. Title
may not be null.
title
-
setTransientOf
public void setTransientOf(Window parent)
Indicates to the window manager that the window is a transient dialog
associated with the application window parent. This allows the window
manager to do things like center window on parent and keep window
above parent.
parent
-
setUnmanaged
public void setUnmanaged(boolean unmanaged)
show
public void show()
Raises the window
to the top of the window stack (moves the window to the front of the Z-order).
showUnraised
public void showUnraised()
Shows a GdkWindow
onscreen, but does not modify its stacking order.
In contrast, show()
will raise the window to the top of the window stack.
stick
public void stick()
Asks to stick window, which means that it will appear on all user
desktops. Note that you shouldn't assume the window is definitely stuck
afterward, because other entities (e.g. the user or window manager) could
unstick it again, and some window managers do not support sticking
windows. But normally the window will end up stuck. Just don't write code
that crashes if not.
unmaximize
public void unmaximize()
Asks to unmaximize window.
unstick
public void unstick()
Asks to unstick window, which means that it will appear on only one of
the user's desktops. Note that you shouldn't assume the window is
definitely unstuck afterward, because other entities (e.g. the user or
window manager) could stick it again. But normally the window will end
up unstuck. Just don't write code that crashes if not.
withdraw
public void withdraw()
Withdraws a window (unmaps it and asks the window manager to forget about it).