org.gnu.gdk
Class Window

java.lang.Object
  |
  +--org.gnu.glib.GObject
        |
        +--org.gnu.gdk.Drawable
              |
              +--org.gnu.gdk.Window

public class Window
extends Drawable

TODO: wrap many methods. implement new methods like getTitle, getDimension, ... using attributes field. Look through the window events model.


Constructor Summary
Window(int handle)
           
Window(Window parent, WindowAttr attributes, int attributesMask)
           
 
Method Summary
 void clear()
          Clears an entire window to the background color or background pixmap.
 void clearArea(int x, int y, int width, int height)
           
 void destroy()
           
 void drawLine(GC gcontext, int x1, int y1, int x2, int y2)
           
 void drawLine(int x1, int y1, int x2, int y2)
           
 void drawPoint(GC gcontext, int x, int y)
          Drawing Functions
 void drawPoint(int x, int y)
           
 int getHeight()
          Retrieve the current height of the Window.
 void getKeyboardFocus()
           
static Window[] getTopLevelWindows()
           
 int getWidth()
          Retrieve the current width of the Window.
 Window getWindowAt(int x, int y)
          Obtains the window underneath the mouse pointer, returning the location of that window in win_x, win_y.
 WindowState getWindowState()
           
 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.
 boolean isViewable()
           
 boolean isVisible()
           
 void lower()
           
 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 (i.e.
 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 setBitmapMask(Bitmap mask, int x, int y)
           
 void setChildMask(boolean masked)
           
 void setHint(WindowTypeHint hint)
           
 void setRegionMask(Region region, int x, int y)
           
 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 withdraw()
          Withdraws a window (unmaps it and asks the window manager to forget about it).
 
Methods inherited from class org.gnu.gdk.Drawable
getClipRegion, getColormap, getDepth, getImage, getSize, getVisibleRegion, getVisual, setColormap
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, equals, getData, getHandle, removeEventHandler, setData
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Window

public Window(int handle)

Window

public Window(Window parent,
              WindowAttr attributes,
              int attributesMask)
Method Detail

destroy

public void destroy()

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).

Parameters:
x - X position of the window.
y - Y position of the window.
Returns:
The window at the specified location.

show

public void show()
Raises the window to the top of the window stack (moves the window to the front of the Z-order).


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.


withdraw

public void withdraw()
Withdraws a window (unmaps it and asks the window manager to forget about it).


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.


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.

Parameters:
x - new x position.
y - new y position.

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.

Parameters:
width - the new window width.
height - the new window height.

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 (i.e. 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.

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.

Parameters:
parent - the new parent to move window into.
x - X location inside the new parent.
y - Y location inside the new parent.

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)

raise

public void raise()

lower

public void lower()

getKeyboardFocus

public void getKeyboardFocus()

setUnmanaged

public void setUnmanaged(boolean unmanaged)

scrollContent

public void scrollContent(int x,
                          int y)

setBitmapMask

public void setBitmapMask(Bitmap mask,
                          int x,
                          int y)

setRegionMask

public void setRegionMask(Region region,
                          int x,
                          int y)

setChildMask

public void setChildMask(boolean masked)

isVisible

public boolean isVisible()

isViewable

public boolean isViewable()

getWindowState

public WindowState getWindowState()

setHint

public void setHint(WindowTypeHint hint)

drawPoint

public void drawPoint(GC gcontext,
                      int x,
                      int y)
Drawing Functions


drawPoint

public void drawPoint(int x,
                      int y)

drawLine

public void drawLine(GC gcontext,
                     int x1,
                     int y1,
                     int x2,
                     int y2)

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)

getTopLevelWindows

public static Window[] getTopLevelWindows()

getWidth

public int getWidth()
Retrieve the current width of the Window.

Returns:
The width of the Window.

getHeight

public int getHeight()
Retrieve the current height of the Window.

Returns:
The height of the Window.

Please send any bug reports, comments, or suggestions for the API or documentation to java-gnome-developer@lists.sf.net