Display

Instances of this class are responsible for managing the connection between SWT and the underlying operating system. Their most important function is to implement the SWT event loop in terms of the platform event model. They also provide various methods for accessing information about the operating system, and have overall control over the operating system resources which SWT allocates. <p> Applications which are built with SWT will <em>almost always</em> require only a single display. In particular, some platforms which SWT supports will not allow more than one <em>active</em> display. In other words, some platforms do not support creating a new display if one already exists that has not been sent the <code>dispose()</code> message. <p> In SWT, the thread which creates a <code>Display</code> instance is distinguished as the <em>user-interface thread</em> for that display. </p> The user-interface thread for a particular display has the following special attributes: <ul> <li> The event loop for that display must be run from the thread. </li> <li> Some SWT API methods (notably, most of the public methods in <code>Widget</code> and its subclasses), may only be called from the thread. (To support multi-threaded user-interface applications, class <code>Display</code> provides inter-thread communication methods which allow threads other than the user-interface thread to request that it perform operations on their behalf.) </li> <li> The thread is not allowed to construct other <code>Display</code>s until that display has been disposed. (Note that, this is in addition to the restriction mentioned above concerning platform support for multiple displays. Thus, the only way to have multiple simultaneously active displays, even on platforms which support it, is to have multiple threads.) </li> </ul> Enforcing these attributes allows SWT to be implemented directly on the underlying operating system's event model. This has numerous benefits including smaller footprint, better use of resources, safer memory management, clearer program logic, better performance, and fewer overall operating system threads required. The down side however, is that care must be taken (only) when constructing multi-threaded applications to use the inter-thread communication mechanisms which this class provides when required. </p><p> All SWT API methods which may only be called from the user-interface thread are distinguished in their documentation by indicating that they throw the "<code>ERROR_THREAD_INVALID_ACCESS</code>" SWT exception. </p> <dl> <dt><b>Styles:</b></dt> <dd>(none)</dd> <dt><b>Events:</b></dt> <dd>Close, Dispose, Settings</dd> </dl> <p> IMPORTANT: This class is <em>not</em> intended to be subclassed. </p> @see #syncExec @see #asyncExec @see #wake @see #readAndDispatch @see #sleep @see Device#dispose @see <a href="http://www.eclipse.org/swt/snippets/#display">Display snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

class Display : Device {
int gdkEventCount;
GdkEvent*[] gdkEvents;
Widget[] gdkEventWidgets;
int[] dispatchEvents;
Event[] eventQueue;
GPollFD[] fds;
int allocated_nfds;
bool wake_state;
int max_priority;
int timeout;
void* eventCallback;
void* filterCallback;
CallbackData*[int] windowProcCallbackDatas;
CallbackData filterProcCallbackData;
EventTable eventTable;
EventTable filterTable;
String APP_NAME;
String DISPATCH_EVENT_KEY;
String ADD_WIDGET_KEY;
GClosure*[] closures;
int[] signalIds;
ptrdiff_t[] indexTable;
ptrdiff_t freeSlot;
GtkWidget* lastHandle;
Widget lastWidget;
Widget[] widgetTable;
int GROW_SIZE;
int SWT_OBJECT_INDEX;
int SWT_OBJECT_INDEX1;
int SWT_OBJECT_INDEX2;
Shell[] modalShells;
Dialog modalDialog;
String GET_MODAL_DIALOG;
String SET_MODAL_DIALOG;
int focusEvent;
Control focusControl;
Shell activeShell;
bool activePending;
bool ignoreActivate;
bool ignoreFocus;
Control imControl;
GtkWindow* preeditWindow;
GtkLabel* preeditLabel;
Synchronizer synchronizer;
Thread thread;
Runnable[] disposeList;
Tray tray;
int[] timerIds;
Runnable[] timerList;
CallbackData timerProcCallbackData;
Caret currentCaret;
int caretId;
CallbackData caretProcCallbackData;
Control mnemonicControl;
int mouseHoverId;
GtkWidget* mouseHoverHandle;
CallbackData mouseHoverProcCallbackData;
CallbackData shellMapProcCallbackData;
GClosure* shellMapProcClosure;
CallbackData idleProcCallbackData;
uint idleHandle;
String ADD_IDLE_PROC_KEY;
String REMOVE_IDLE_PROC_KEY;
Object idleLock;
bool idleNeeded;
int[] treeSelection;
int treeSelectionLength;
CallbackData setDirectionProcCallbackData;
String GET_DIRECTION_PROC_KEY;
CallbackData emissionProcCallbackData;
String GET_EMISSION_PROC_KEY;
CallbackData allChildrenProcCallbackData;
GList* allChildren;
CallbackData cellDataProcCallbackData;
GtkWidget* shellHandle;
bool settingsChanged;
bool runSettingsFld;
CallbackData styleSetProcCallbackData;
bool entrySelectOnFocus;
Control currentControl;
int checkIfEventProc;
void* checkIfEventCallback;
GdkWindow* flushWindow;
bool flushAll;
GdkRectangle* flushRect;
XExposeEvent* exposeEvent;
XVisibilityEvent* visibilityEvent;
Font systemFont;
Image errorImage;
Image infoImage;
Image questionImage;
Image warningImage;
Cursor[] cursors;
Resource[] resources;
int RESOURCE_SIZE;
GdkColor* COLOR_WIDGET_DARK_SHADOW;
GdkColor* COLOR_WIDGET_NORMAL_SHADOW;
GdkColor* COLOR_WIDGET_LIGHT_SHADOW;
GdkColor* COLOR_WIDGET_HIGHLIGHT_SHADOW;
GdkColor* COLOR_WIDGET_BACKGROUND;
GdkColor* COLOR_WIDGET_FOREGROUND;
GdkColor* COLOR_WIDGET_BORDER;
GdkColor* COLOR_LIST_FOREGROUND;
GdkColor* COLOR_LIST_BACKGROUND;
GdkColor* COLOR_LIST_SELECTION;
GdkColor* COLOR_LIST_SELECTION_TEXT;
GdkColor* COLOR_INFO_BACKGROUND;
GdkColor* COLOR_INFO_FOREGROUND;
GdkColor* COLOR_TITLE_FOREGROUND;
GdkColor* COLOR_TITLE_BACKGROUND;
GdkColor* COLOR_TITLE_BACKGROUND_GRADIENT;
GdkColor* COLOR_TITLE_INACTIVE_FOREGROUND;
GdkColor* COLOR_TITLE_INACTIVE_BACKGROUND;
GdkColor* COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT;
Menu[] popups;
int clickCount;
int lastEventTime;
int lastUserEventTime;
ptrdiff_t fixed_type;
ptrdiff_t fixed_info_ptr;
void function(GtkWidget* handle, GtkAllocation* allocation) oldFixedSizeAllocateProc;
ptrdiff_t text_renderer_type;
ptrdiff_t pixbuf_renderer_type;
ptrdiff_t toggle_renderer_type;
ptrdiff_t text_renderer_info_ptr;
ptrdiff_t pixbuf_renderer_info_ptr;
ptrdiff_t toggle_renderer_info_ptr;
int[][] KeyTable;
Display Default;
Display[] Displays;
String PACKAGE_PREFIX;
int MAJOR;
int MINOR;
int MICRO;
Object data;
String[] keys;
Object[] values;
int borderTrimWidth;
int borderTrimHeight;
int resizeTrimWidth;
int resizeTrimHeight;
int titleBorderTrimWidth;
int titleBorderTrimHeight;
int titleResizeTrimWidth;
int titleResizeTrimHeight;
int titleTrimWidth;
int titleTrimHeight;
bool ignoreTrim;
String windowManager;
}

Constructors

this
this()

Constructs a new instance of this class. <p> Note: The resulting display is marked as the <em>current</em> display. If this is the first display which has been constructed since the application started, it is also marked as the <em>default</em> display. </p>

this
this(DeviceData data)

Constructs a new instance of this class using the parameter.

Members

Functions

addFilter
void addFilter(int eventType, Listener listener)

Adds the listener to the collection of listeners who will be notified when an event of the given type occurs anywhere in a widget. The event type is one of the event constants defined in class <code>SWT</code>. When the event does occur, the listener is notified by sending it the <code>handleEvent()</code> message. <p> Setting the type of an event to <code>SWT.None</code> from within the <code>handleEvent()</code> method can be used to change the event type and stop subsequent Java listeners from running. Because event filters run before other listeners, event filters can both block other listeners and set arbitrary fields within an event. For this reason, event filters are both powerful and dangerous. They should generally be avoided for performance, debugging and code maintenance reasons. </p>

addListener
void addListener(int eventType, Listener listener)

Adds the listener to the collection of listeners who will be notified when an event of the given type occurs. The event type is one of the event constants defined in class <code>SWT</code>. When the event does occur in the display, the listener is notified by sending it the <code>handleEvent()</code> message.

asyncExec
void asyncExec(Runnable runnable)

Causes the <code>run()</code> method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. The caller of this method continues to run in parallel, and is not notified when the runnable has completed. Specifying <code>null</code> as the runnable simply wakes the user-interface thread when run. <p> Note that at the time the runnable is invoked, widgets that have the receiver as their display may have been disposed. Therefore, it is necessary to check for this case inside the runnable before accessing the widget. </p>

beep
void beep()

Causes the system hardware to emit a short sound (if it supports this capability).

checkSubclass
void checkSubclass()

Checks that this class can be subclassed. <p> IMPORTANT: See the comment in <code>Widget.checkSubclass()</code>. </p>

close
void close()

Requests that the connection between SWT and the underlying operating system be closed.

create
void create(DeviceData data)

Creates the device in the operating system. If the device does not have a handle, this method may do nothing depending on the device. <p> This method is called before <code>init</code>. </p>

destroy
void destroy()

Destroys the device in the operating system and releases the device's handle. If the device does not have a handle, this method may do nothing depending on the device. <p> This method is called after <code>release</code>. </p> @see Device#dispose @see #release

disposeExec
void disposeExec(Runnable runnable)

Causes the <code>run()</code> method of the runnable to be invoked by the user-interface thread just before the receiver is disposed. Specifying a <code>null</code> runnable is ignored.

error
void error(int code)

Does whatever display specific cleanup is required, and then uses the code in <code>SWTError.error</code> to handle the error.

findWidget
Widget findWidget(GtkWidget* handle)

Given the operating system handle for a widget, returns the instance of the <code>Widget</code> subclass which represents it in the currently running application, if such exists, or null if no matching widget can be found. <p> <b>IMPORTANT:</b> This method should not be called from application code. The arguments are platform-specific. </p>

findWidget
Widget findWidget(GtkWidget* handle, int id)

Given the operating system handle for a widget, and widget-specific id, returns the instance of the <code>Widget</code> subclass which represents the handle/id pair in the currently running application, if such exists, or null if no matching widget can be found. <p> <b>IMPORTANT:</b> This method should not be called from application code. The arguments are platform-specific. </p>

findWidget
Widget findWidget(Widget widget, ptrdiff_t id)

Given a widget and a widget-specific id, returns the instance of the <code>Widget</code> subclass which represents the widget/id pair in the currently running application, if such exists, or null if no matching widget can be found.

getActiveShell
Shell getActiveShell()

Returns the currently active <code>Shell</code>, or null if no shell belonging to the currently running application is active.

getBounds
Rectangle getBounds()

Returns a rectangle describing the receiver's size and location. Note that on multi-monitor systems the origin can be negative.

getCursorControl
Control getCursorControl()

Returns the control which the on-screen pointer is currently over top of, or null if it is not currently over one of the controls built by the currently running application.

getCursorLocation
Point getCursorLocation()

Returns the location of the on-screen pointer relative to the top left corner of the screen.

getCursorSizes
Point[] getCursorSizes()

Returns an array containing the recommended cursor sizes.

getDPI
Point getDPI()

Returns a point whose x coordinate is the horizontal dots per inch of the display, and whose y coordinate is the vertical dots per inch of the display.

getData
Object getData(String key)

Returns the application defined property of the receiver with the specified name, or null if it has not been set. <p> Applications may have associated arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the display is disposed of, it is the application's responsibility to provide a <code>disposeExec()</code> handler which does so. </p>

getData
Object getData()

Returns the application defined, display specific data associated with the receiver, or null if it has not been set. The <em>display specific data</em> is a single, unnamed field that is stored with every display. <p> Applications may put arbitrary objects in this field. If the object stored in the display specific data needs to be notified when the display is disposed of, it is the application's responsibility to provide a <code>disposeExec()</code> handler which does so. </p>

getDismissalAlignment
int getDismissalAlignment()

Returns the button dismissal alignment, one of <code>LEFT</code> or <code>RIGHT</code>. The button dismissal alignment is the ordering that should be used when positioning the default dismissal button for a dialog. For example, in a dialog that contains an OK and CANCEL button, on platforms where the button dismissal alignment is <code>LEFT</code>, the button ordering should be OK/CANCEL. When button dismissal alignment is <code>RIGHT</code>, the button ordering should be CANCEL/OK.

getDoubleClickTime
int getDoubleClickTime()

Returns the longest duration, in milliseconds, between two mouse button clicks that will be considered a <em>double click</em> by the underlying operating system.

getFocusControl
Control getFocusControl()

Returns the control which currently has keyboard focus, or null if keyboard events are not currently going to any of the controls built by the currently running application.

getHighContrast
bool getHighContrast()

Returns true when the high contrast mode is enabled. Otherwise, false is returned. <p> Note: This operation is a hint and is not supported on platforms that do not have this concept. </p>

getIconDepth
int getIconDepth()

Returns the maximum allowed depth of icons on this display, in bits per pixel. On some platforms, this may be different than the actual depth of the display.

getIconSizes
Point[] getIconSizes()

Returns an array containing the recommended icon sizes.

getMonitors
org.eclipse.swt.widgets.Monitor.Monitor[] getMonitors()

Returns an array of monitors attached to the device.

getPrimaryMonitor
org.eclipse.swt.widgets.Monitor.Monitor getPrimaryMonitor()

Returns the primary monitor for that device.

getShells
Shell[] getShells()

Returns a (possibly empty) array containing all shells which have not been disposed and have the receiver as their display.

getSyncThread
Thread getSyncThread()

Returns the thread that has invoked <code>syncExec</code> or null if no such runnable is currently being invoked by the user-interface thread. <p> Note: If a runnable invoked by asyncExec is currently running, this method will return null. </p>

getSynchronizer
Synchronizer getSynchronizer()

Gets the synchronizer used by the display.

getSystemColor
Color getSystemColor(int id)

Returns the matching standard color for the given constant, which should be one of the color constants specified in class <code>SWT</code>. Any value other than one of the SWT color constants which is passed in will result in the color black. This color should not be free'd because it was allocated by the system, not the application.

getSystemCursor
Cursor getSystemCursor(int id)

Returns the matching standard platform cursor for the given constant, which should be one of the cursor constants specified in class <code>SWT</code>. This cursor should not be free'd because it was allocated by the system, not the application. A value of <code>null</code> will be returned if the supplied constant is not an SWT cursor constant.

getSystemFont
Font getSystemFont()

Returns a reasonable font for applications to use. On some platforms, this will match the "default font" or "system font" if such can be found. This font should not be free'd because it was allocated by the system, not the application. <p> Typically, applications which want the default look should simply not set the font on the widgets they create. Widgets are always created with the correct default font for the class of user-interface component they represent. </p>

getSystemImage
Image getSystemImage(int id)

Returns the matching standard platform image for the given constant, which should be one of the icon constants specified in class <code>SWT</code>. This image should not be free'd because it was allocated by the system, not the application. A value of <code>null</code> will be returned either if the supplied constant is not an SWT icon constant or if the platform does not define an image that corresponds to the constant.

getSystemTray
Tray getSystemTray()

Returns the single instance of the system tray or null when there is no system tray available for the platform.

getThread
Thread getThread()

Returns the user-interface thread for the receiver.

getWorkArea
Rectangle getWorkArea()

Returns the work area, an EWMH property to store the size and position of the screen not covered by dock and panel windows. See http://freedesktop.org/Standards/wm-spec.

init_
void init_()

Initializes any internal resources needed by the device. <p> This method is called after <code>create</code>. </p>

internal_dispose_GC
void internal_dispose_GC(GdkGC* gdkGC, GCData data)

Invokes platform specific functionality to dispose a GC handle. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Display</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>

internal_new_GC
GdkGC* internal_new_GC(GCData data)

Invokes platform specific functionality to allocate a new GC handle. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Display</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>

map
Point map(Control from, Control to, Point point)

Maps a point from one coordinate system to another. When the control is null, coordinates are mapped to the display. <p> NOTE: On right-to-left platforms where the coordinate systems are mirrored, special care needs to be taken when mapping coordinates from one control to another to ensure the result is correctly mirrored.

map
Point map(Control from, Control to, int x, int y)

Maps a point from one coordinate system to another. When the control is null, coordinates are mapped to the display. <p> NOTE: On right-to-left platforms where the coordinate systems are mirrored, special care needs to be taken when mapping coordinates from one control to another to ensure the result is correctly mirrored.

map
Rectangle map(Control from, Control to, Rectangle rectangle)

Maps a point from one coordinate system to another. When the control is null, coordinates are mapped to the display. <p> NOTE: On right-to-left platforms where the coordinate systems are mirrored, special care needs to be taken when mapping coordinates from one control to another to ensure the result is correctly mirrored.

map
Rectangle map(Control from, Control to, int x, int y, int width, int height)

Maps a point from one coordinate system to another. When the control is null, coordinates are mapped to the display. <p> NOTE: On right-to-left platforms where the coordinate systems are mirrored, special care needs to be taken when mapping coordinates from one control to another to ensure the result is correctly mirrored.

post
bool post(Event event)

Generate a low level system event.

readAndDispatch
bool readAndDispatch()

Reads an event from the operating system's event queue, dispatches it appropriately, and returns <code>true</code> if there is potentially more work to do, or <code>false</code> if the caller can sleep until another event is placed on the event queue. <p> In addition to checking the system event queue, this method also checks if any inter-thread messages (created by <code>syncExec()</code> or <code>asyncExec()</code>) are waiting to be processed, and if so handles them before returning. </p>

release
void release()

Releases any internal resources back to the operating system and clears all fields except the device handle. <p> Disposes all shells which are currently open on the display. After this method has been invoked, all related related shells will answer <code>true</code> when sent the message <code>isDisposed()</code>. </p><p> When a device is destroyed, resources that were acquired on behalf of the programmer need to be returned to the operating system. For example, if the device allocated a font to be used as the system font, this font would be freed in <code>release</code>. Also,to assist the garbage collector and minimize the amount of memory that is not reclaimed when the programmer keeps a reference to a disposed device, all fields except the handle are zero'd. The handle is needed by <code>destroy</code>. </p> This method is called before <code>destroy</code>.

removeFilter
void removeFilter(int eventType, Listener listener)

Removes the listener from the collection of listeners who will be notified when an event of the given type occurs anywhere in a widget. The event type is one of the event constants defined in class <code>SWT</code>.

removeListener
void removeListener(int eventType, Listener listener)

Removes the listener from the collection of listeners who will be notified when an event of the given type occurs. The event type is one of the event constants defined in class <code>SWT</code>.

setCursorLocation
void setCursorLocation(int x, int y)

Sets the location of the on-screen pointer relative to the top left corner of the screen. <b>Note: It is typically considered bad practice for a program to move the on-screen pointer location.</b>

setCursorLocation
void setCursorLocation(Point point)

Sets the location of the on-screen pointer relative to the top left corner of the screen. <b>Note: It is typically considered bad practice for a program to move the on-screen pointer location.</b>

setData
void setData(String key, Object value)

Sets the application defined property of the receiver with the specified name to the given argument. <p> Applications may have associated arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the display is disposed of, it is the application's responsibility provide a <code>disposeExec()</code> handler which does so. </p>

setData
void setData(Object data)

Sets the application defined, display specific data associated with the receiver, to the argument. The <em>display specific data</em> is a single, unnamed field that is stored with every display. <p> Applications may put arbitrary objects in this field. If the object stored in the display specific data needs to be notified when the display is disposed of, it is the application's responsibility provide a <code>disposeExec()</code> handler which does so. </p>

setSynchronizer
void setSynchronizer(Synchronizer synchronizer)

Sets the synchronizer used by the display to be the argument, which can not be null.

sleep
bool sleep()

Causes the user-interface thread to <em>sleep</em> (that is, to be put in a state where it does not consume CPU cycles) until an event is received or it is otherwise awakened.

syncExec
void syncExec(Runnable runnable)

Causes the <code>run()</code> method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. The thread which calls this method is suspended until the runnable completes. Specifying <code>null</code> as the runnable simply wakes the user-interface thread. <p> Note that at the time the runnable is invoked, widgets that have the receiver as their display may have been disposed. Therefore, it is necessary to check for this case inside the runnable before accessing the widget. </p>

timerExec
void timerExec(int milliseconds, Runnable runnable)

Causes the <code>run()</code> method of the runnable to be invoked by the user-interface thread after the specified number of milliseconds have elapsed. If milliseconds is less than zero, the runnable is not executed. <p> Note that at the time the runnable is invoked, widgets that have the receiver as their display may have been disposed. Therefore, it is necessary to check for this case inside the runnable before accessing the widget. </p>

update
void update()

Forces all outstanding paint requests for the display to be processed before this method returns.

wake
void wake()

If the receiver's user-interface thread was <code>sleep</code>ing, causes it to be awakened and start running again. Note that this method may be called from any thread.

Static functions

findDisplay
Display findDisplay(Thread thread)

Returns the display which the given thread is the user-interface thread for, or null if the given thread is not a user-interface thread for any display. Specifying <code>null</code> as the thread will return <code>null</code> for the display.

getCurrent
Display getCurrent()

Returns the display which the currently running thread is the user-interface thread for, or null if the currently running thread is not a user-interface thread for any display.

getDefault
Display getDefault()

Returns the default display. One is created (making the thread that invokes this method its user-interface thread) if it did not already exist.

setAppName
void setAppName(String name)

On platforms which support it, sets the application name to be the argument. On Motif, for example, this can be used to set the name used for resource lookup. Specifying <code>null</code> for the name clears it.

Inherited Members

From Device

xDisplay
void* xDisplay;

the handle to the X Display (Warning: This field is platform dependent) <p> <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT public API. It is marked protected only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code. </p>

checkDevice
void checkDevice()

Throws an <code>SWTException</code> if the receiver can not be accessed by the caller. This may include both checks on the state of the receiver and more generally on the entire execution context. This method <em>should</em> be called by device implementors to enforce the standard SWT invariants. <p> Currently, it is an error to invoke any method (other than <code>isDisposed()</code> and <code>dispose()</code>) on a device that has had its <code>dispose()</code> method called. </p><p> In future releases of SWT, there may be more or fewer error checks and exceptions may be thrown for different reasons. <p>

create
void create(DeviceData data)

Creates the device in the operating system. If the device does not have a handle, this method may do nothing depending on the device. <p> This method is called before <code>init</code>. </p><p> Subclasses are supposed to reimplement this method and not call the <code>super</code> implementation. </p>

dispose
void dispose()

Disposes of the operating system resources associated with the receiver. After this method has been invoked, the receiver will answer <code>true</code> when sent the message <code>isDisposed()</code>.

destroy
void destroy()

Destroys the device in the operating system and releases the device's handle. If the device does not have a handle, this method may do nothing depending on the device. <p> This method is called after <code>release</code>. </p><p> Subclasses are supposed to reimplement this method and not call the <code>super</code> implementation. </p>

getBounds
Rectangle getBounds()

Returns a rectangle describing the receiver's size and location.

getDeviceData
DeviceData getDeviceData()

Returns a <code>DeviceData</code> based on the receiver. Modifications made to this <code>DeviceData</code> will not affect the receiver.

getClientArea
Rectangle getClientArea()

Returns a rectangle which describes the area of the receiver which is capable of displaying data.

getDepth
int getDepth()

Returns the bit depth of the screen, which is the number of bits it takes to represent the number of unique colors that the screen is currently capable of displaying. This number will typically be one of 1, 8, 15, 16, 24 or 32.

getDPI
Point getDPI()

Returns a point whose x coordinate is the horizontal dots per inch of the display, and whose y coordinate is the vertical dots per inch of the display.

getFontList
FontData[] getFontList(String faceName, bool scalable)

Returns <code>FontData</code> objects which describe the fonts that match the given arguments. If the <code>faceName</code> is null, all fonts will be returned.

getSystemColor
Color getSystemColor(int id)

Returns the matching standard color for the given constant, which should be one of the color constants specified in class <code>SWT</code>. Any value other than one of the SWT color constants which is passed in will result in the color black. This color should not be freed because it was allocated by the system, not the application.

getSystemFont
Font getSystemFont()

Returns a reasonable font for applications to use. On some platforms, this will match the "default font" or "system font" if such can be found. This font should not be freed because it was allocated by the system, not the application. <p> Typically, applications which want the default look should simply not set the font on the widgets they create. Widgets are always created with the correct default font for the class of user-interface component they represent. </p>

getWarnings
bool getWarnings()

Returns <code>true</code> if the underlying window system prints out warning messages on the console, and <code>setWarnings</code> had previously been called with <code>true</code>.

init_
void init_()

Initializes any internal resources needed by the device. <p> This method is called after <code>create</code>. </p><p> If subclasses reimplement this method, they must call the <code>super</code> implementation. </p>

internal_new_GC
GdkGC* internal_new_GC(GCData data)

Invokes platform specific functionality to allocate a new GC handle. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Device</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>

internal_dispose_GC
void internal_dispose_GC(GdkGC* handle, GCData data)

Invokes platform specific functionality to dispose a GC handle. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Device</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>

isDisposed
bool isDisposed()

Returns <code>true</code> if the device has been disposed, and <code>false</code> otherwise. <p> This method gets the dispose state for the device. When a device has been disposed, it is an error to invoke any other method using the device.

loadFont
bool loadFont(String path)

Loads the font specified by a file. The font will be present in the list of fonts available to the application.

release
void release()

Releases any internal resources back to the operating system and clears all fields except the device handle. <p> When a device is destroyed, resources that were acquired on behalf of the programmer need to be returned to the operating system. For example, if the device allocated a font to be used as the system font, this font would be freed in <code>release</code>. Also,to assist the garbage collector and minimize the amount of memory that is not reclaimed when the programmer keeps a reference to a disposed device, all fields except the handle are zero'd. The handle is needed by <code>destroy</code>. </p> This method is called before <code>destroy</code>. </p><p> If subclasses reimplement this method, they must call the <code>super</code> implementation. </p>

setWarnings
void setWarnings(bool warnings)

If the underlying window system supports printing warning messages to the console, setting warnings to <code>false</code> prevents these messages from being printed. If the argument is <code>true</code> then message printing is not blocked.

Meta