org.gnu.gdk
Class Screen

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by org.gnu.gdk.Screen

public class Screen
extends GObject

Screen objects are the GDK representation of a physical screen. It is used throughout GDK and GTK+ to specify which screen the top level windows are to be displayed on. It is also used to query the screen specification and default settings such as the default colormap, the screen width, etc.

Note that a Screen may consist of multiple monitors which are merged to form a large screen area.


Constructor Summary
Screen()
          Creates and object representing the default Screen for the default Display.
Screen(org.gnu.glib.Handle handle)
           
 
Method Summary
 void broadcastClientMessage(Event evt)
          On X11, sends an X ClientMessage event to all toplevel windows on screen.
 Colormap getDefaultColormap()
          Returns the default Colormap for this screen.
 Display getDisplay()
          Returns the display that belongs to this Screen.
 int getHeight()
          Gets the height of the Screen in pixels.
 int getHeightMM()
          Gets the height of the Screen in milimeters.
 int getMonitorAtPoint(int x, int y)
          Returns the monitor number in which the point (x,y) is located.
 int getMonitorAtWindow(Window win)
          Returns the number of the monitor in which the largest area of the bounding rectangle of the Window resides.
 Rectangle getMonitorGeometry(int monitorNum)
          Returns a Rectangle representing the size and position of the individual monitor within the entire Screen area.
 int getNumber()
          Gets the index of this Screen among the Screens in the Display to which it belongs.
 int getNumMonitors()
          Returns the number of monitors which Screen consists of.
 Colormap getRGBAColormap()
           
 Visual getRGBAVisual()
           
 Colormap getRGBColormap()
          Gets the preferred colormap for rendering image data on screen.
 Visual getRGBVisual()
          Gets a "preferred visual" chosen by RGB for rendering image data on screen.
 Window getRootWindow()
          Returns the root window of the Screen.
static Screen getScreenFromHandle(org.gnu.glib.Handle hndl)
          Internal static factory method to be used only internally by Java-Gnome.
 Colormap getSystemColormap()
          Returns the system's default Colormap for Screens
 Visual getSystemVisual()
          Returns the system's default Visual for Screens.
 Window[] getToplevelWindows()
          Returns a list of all known toplevel Windows on the Screen.
 Type getType()
           
 int getWidth()
          Gets the width of the Screen in pixels.
 int getWidthMM()
          Gets the width of the Screen in milimeters.
 Visual[] listVisuals()
          List the Visuals for this Screen.
 java.lang.String makeDisplayName()
          Returns the name to pass to the Display constructor to create a Display with this Screen as the default Screen.
 void setDefaultColormap(Colormap colormap)
          Sets the default Colormap for this screen.
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Screen

public Screen()
Creates and object representing the default Screen for the default Display.


Screen

public Screen(org.gnu.glib.Handle handle)
Method Detail

getDefaultColormap

public Colormap getDefaultColormap()
Returns the default Colormap for this screen.


setDefaultColormap

public void setDefaultColormap(Colormap colormap)
Sets the default Colormap for this screen.

Parameters:
colormap -

getSystemColormap

public Colormap getSystemColormap()
Returns the system's default Colormap for Screens


getSystemVisual

public Visual getSystemVisual()
Returns the system's default Visual for Screens. This is the Visual for the root window of the Display.


getRGBColormap

public Colormap getRGBColormap()
Gets the preferred colormap for rendering image data on screen.


getRGBAColormap

public Colormap getRGBAColormap()

getRGBVisual

public Visual getRGBVisual()
Gets a "preferred visual" chosen by RGB for rendering image data on screen.


getRGBAVisual

public Visual getRGBAVisual()

getRootWindow

public Window getRootWindow()
Returns the root window of the Screen.


getDisplay

public Display getDisplay()
Returns the display that belongs to this Screen.


getNumber

public int getNumber()
Gets the index of this Screen among the Screens in the Display to which it belongs.


getHeight

public int getHeight()
Gets the height of the Screen in pixels.


getWidth

public int getWidth()
Gets the width of the Screen in pixels.


getHeightMM

public int getHeightMM()
Gets the height of the Screen in milimeters.


getWidthMM

public int getWidthMM()
Gets the width of the Screen in milimeters.


listVisuals

public Visual[] listVisuals()
List the Visuals for this Screen. A Visual describes a hardware image data format. For example, a visual might support 24-bit color, or 8-bit color, and might expect pixels to be in a certain format.


getToplevelWindows

public Window[] getToplevelWindows()
Returns a list of all known toplevel Windows on the Screen. A toplevel Window is a child of the root window.


makeDisplayName

public java.lang.String makeDisplayName()
Returns the name to pass to the Display constructor to create a Display with this Screen as the default Screen.


getNumMonitors

public int getNumMonitors()
Returns the number of monitors which Screen consists of.


getMonitorGeometry

public Rectangle getMonitorGeometry(int monitorNum)
Returns a Rectangle representing the size and position of the individual monitor within the entire Screen area.

Parameters:
monitorNum -

getMonitorAtPoint

public int getMonitorAtPoint(int x,
                             int y)
Returns the monitor number in which the point (x,y) is located.

Parameters:
x -
y -

getMonitorAtWindow

public int getMonitorAtWindow(Window win)
Returns the number of the monitor in which the largest area of the bounding rectangle of the Window resides.

Parameters:
win -

broadcastClientMessage

public void broadcastClientMessage(Event evt)
On X11, sends an X ClientMessage event to all toplevel windows on screen. Toplevel windows are determined by checking for the WM_STATE property, as described in the Inter-Client Communication Conventions Manual (ICCCM). If no windows are found with the WM_STATE property set, the message is sent to all children of the root window. On Windows, broadcasts a message registered with the name GDK_WIN32_CLIENT_MESSAGE to all top-level windows. The amount of data is limited to one long, i.e. four bytes.

Parameters:
evt -

getType

public Type getType()

getScreenFromHandle

public static Screen getScreenFromHandle(org.gnu.glib.Handle hndl)
Internal static factory method to be used only internally by Java-Gnome.