org.gnu.gdk

Class 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(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
getNumMonitors()
Returns the number of monitors which Screen consists of.
int
getNumber()
Gets the index of this Screen among the Screens in the Display to which it belongs.
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(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.
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.

Constructor Details

Screen

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

Screen

public Screen(Handle handle)

Method Details

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 -

getDefaultColormap

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

getDisplay

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

getHeight

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

getHeightMM

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

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 -

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 -

getNumMonitors

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

getNumber

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

getRGBAColormap

public Colormap getRGBAColormap()

getRGBAVisual

public Visual getRGBAVisual()

getRGBColormap

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

getRGBVisual

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

getRootWindow

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

getScreenFromHandle

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

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.

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.

getType

public Type getType()

getWidth

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

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.

makeDisplayName

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

setDefaultColormap

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