Class Display
Applications which are built with SWT will almost always
require only a single display. In particular, some platforms
which SWT supports will not allow more than one active
display. In other words, some platforms do not support
creating a new display if one already exists that has not been
sent the dispose() message.
In SWT, the thread which creates a Display
instance is distinguished as the user-interface thread
for that display.
- The event loop for that display must be run from the thread.
-
Some SWT API methods (notably, most of the public methods in
Widgetand its subclasses), may only be called from the thread. (To support multi-threaded user-interface applications, classDisplayprovides inter-thread communication methods which allow threads other than the user-interface thread to request that it perform operations on their behalf.) -
The thread is not allowed to construct other
Displays 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.)
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.
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 "ERROR_THREAD_INVALID_ACCESS"
SWT exception.
- Styles:
- (none)
- Events:
- Close, Dispose, OpenDocument, Settings, Skin
IMPORTANT: This class is not intended to be subclassed.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) Callback(package private) long(package private) boolean(package private) Shell(package private) static final String(package private) static final String(package private) long(package private) Callback(package private) long(package private) int(package private) static String(package private) static String(package private) int(package private) Callback(package private) int(package private) long(package private) Callback(package private) long(package private) Callback(package private) long(package private) Callback(package private) long(package private) int(package private) long[](package private) int[](package private) long[](package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBA(package private) GdkRGBAprivate static final Pattern(package private) Callback(package private) long(package private) Caret(package private) Control(package private) TrayItem(package private) Cursor[](package private) Object(package private) static Display(package private) static final String(package private) int[](package private) static Display[](package private) Runnable[](package private) long(package private) Callback(package private) Callback(package private) long(package private) boolean(package private) Image(package private) Callback(package private) long(package private) Event[](package private) EventTable(package private) XExposeEvent(package private) static final String(package private) boolean(package private) long(package private) EventTable(package private) static long(package private) boolean(package private) long[](package private) GdkRectangle(package private) long(package private) Callback(package private) Control(package private) int(package private) long(package private) int(package private) int(package private) long[](package private) Widget[](package private) Callback(package private) long(package private) static final String(package private) static final String(package private) static final String(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) Callback(package private) int(package private) Object(package private) boolean(package private) long(package private) boolean(package private) boolean(package private) boolean(package private) long(package private) Control(package private) int[](package private) Image(package private) static final int(package private) Callback(package private) long(package private) String[](package private) Callback(package private) long(package private) static final int[][]private static final int(package private) int(package private) long(package private) int(package private) Widgetprivate int(package private) Composite[](package private) int(package private) Callback(package private) long(package private) int[](package private) Control(package private) Dialog(package private) Shell[](package private) Callback(package private) long(package private) int(package private) long(package private) Callback(package private) long(package private) static final String(package private) long(package private) long(package private) long(package private) static long(package private) static long(package private) Menu[](package private) long(package private) long(package private) long(package private) Image(package private) static final String(package private) static Callback(package private) static long(package private) static Callback(package private) static long(package private) static Callback(package private) static long(package private) static Callback(package private) static long(package private) int(package private) int(package private) int(package private) int(package private) Callback(package private) double(package private) double(package private) int(package private) long(package private) static final int(package private) Resource[](package private) boolean(package private) Consumer<RuntimeException> (package private) Callback(package private) long(package private) SessionManagerDBus(package private) Display.SessionManagerListener(package private) static final String(package private) Callback(package private) long(package private) boolean(package private) Callback(package private) long(package private) long(package private) Callback(package private) long(package private) long(package private) Callback(package private) int[](package private) long(package private) Callback(package private) long(package private) Callback(package private) long(package private) int(package private) Widget[]private static final int(package private) Callback(package private) long(package private) static final int(package private) final int(package private) final int(package private) static final int(package private) static final int(package private) static final int(package private) Synchronizer(package private) static long(package private) static long(package private) static booleanTrue if the current theme is dark.(package private) static StringThe name of the current theme, including the theme named by GTK_THEME.(package private) Thread(package private) int[](package private) Callback(package private) int[](package private) Runnable[](package private) long(package private) static long(package private) static long(package private) Tracker(package private) Tray(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) int[](package private) int[](package private) Object[](package private) boolean(package private) Image(package private) Widget[](package private) Callback(package private) long(package private) Callback(package private) Callback(package private) Callback(package private) Callback(package private) Callback(package private) String(package private) long(package private) long(package private) long(package private) long(package private) long(package private) boolean(package private) Callback(package private) longFields inherited from class Device
CHANGE_SCALEFACTOR, CurrentDevice, DEBUG, DeviceFinder, xDisplay -
Constructor Summary
ConstructorsConstructorDescriptionDisplay()Constructs a new instance of this class.Display(DeviceData data) Constructs a new instance of this class using the parameter. -
Method Summary
Modifier and TypeMethodDescription(package private) static int_getDeviceZoom(long monitor_num) (package private) voidactivateProc(long action, long parameter, long user_data) voidAdds the listener to the collection of listeners who will be notified when an event of the given type occurs anywhere in a widget.(package private) voidaddGdkEvent(long event) (package private) void(package private) voidaddLayoutDeferred(Composite comp) voidaddListener(int eventType, Listener listener) Adds the listener to the collection of listeners who will be notified when an event of the given type occurs.(package private) voidaddMouseHoverTimeout(long handle) (package private) void(package private) voidaddSkinnableWidget(Widget widget) (package private) void(package private) longallChildrenProc(long widget, long recurse) voidCauses therun()method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.voidbeep()Causes the system hardware to emit a short sound (if it supports this capability).(package private) longcaretProc(long clientData) (package private) longcellDataProc(long tree_column, long cell, long tree_model, long iter, long data) (package private) booleanchangeValue(long handle, int scroll, double value, long user_data) (package private) booleancheckAndSetThemeDetails(String themeName) Sets the org.eclipse.swt.internal.gtk.theme value with the current GTK theme name.protected voidThrows anSWTExceptionif the receiver can not be accessed by the caller.(package private) static voidcheckDisplay(Thread thread, boolean multiple) (package private) longcheckIfEventProc(long display, long xEvent, long userData) (package private) voidCheck if the XIM module is present and generates a warning for potential graphical issues if GTK_IM_MODULE=xim is detected.protected voidChecks that this class can be subclassed.(package private) voidclearModal(Shell shell) voidclose()Requests that the connection between SWT and the underlying operating system be closed.(package private) voidcomputeSizeProc(long toplevel, long size, long user_data) (package private) GdkRGBAprotected voidcreate(DeviceData data) Creates the device in the operating system.(package private) voidcreateDisplay(DeviceData data) (package private) ImagecreateImage(String name) (package private) StringdebugInfoForIndex(long index) (package private) static voidderegister(Display display) protected voiddestroy()Destroys the device in the operating system and releases the device's handle.(package private) voidvoiddisposeExec(Runnable runnable) Causes therun()method of the runnable to be invoked by the user-interface thread just before the receiver is disposed.(package private) voiddpiChanged(int newScaleFactor) (package private) String(package private) longemissionProc(long ihint, long n_param_values, long param_values, long data) (package private) voidenterMotionProc(long controller, double x, double y, long user_data) (package private) voiderror(int code) Does whatever display specific cleanup is required, and then uses the code inSWTError.errorto handle the error.(package private) longeventProc(long event, long data) voidExecutes the given runnable in the user-interface thread of this Display.static StringextractFreeGError(long errorPtr) Helper method to extract GError messages.(package private) booleanfilterEvent(Event event) (package private) booleanfilters(int eventType) static DisplayfindDisplay(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.(package private) longprivate intDetermine key group of Latin layout, and update the layout group to key count map.findWidget(long handle) Given the operating system handle for a widget, returns the instance of theWidgetsubclass which represents it in the currently running application, if such exists, or null if no matching widget can be found.findWidget(long handle, long id) Given the operating system handle for a widget, and widget-specific id, returns the instance of theWidgetsubclass which represents the handle/id pair in the currently running application, if such exists, or null if no matching widget can be found.findWidget(Widget widget, long id) Given a widget and a widget-specific id, returns the instance of theWidgetsubclass which represents the widget/id pair in the currently running application, if such exists, or null if no matching widget can be found.(package private) voidflushExposes(long window, boolean all) (package private) voidfocusProc(long controller, long user_data) private voidHandle gdbus on 'org.eclipse.swt' DBus session.(package private) longgdk_device_get_surface_at_position(double[] win_x, double[] win_y) (package private) longgdk_device_get_window_at_position(int[] win_x, int[] win_y) (package private) voidgesturePressReleaseProc(long gesture, int n_press, double x, double y, long user_data) Returns the currently activeShell, or null if no shell belonging to the currently running application is active.static StringReturns the application name.static StringReturns the application version.Returns a rectangle describing the receiver's size and location.(package private) Rectangle(package private) intReturns a rectangle which describes the area of the receiver which is capable of displaying data.(package private) longgetClosure(int id) static DisplayReturns 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.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.Returns the location of the on-screen pointer relative to the top left corner of the screen.Point[]Returns an array containing the recommended cursor sizes.getData()Returns the application defined, display specific data associated with the receiver, or null if it has not been set.Returns the application defined property of the receiver with the specified name, or null if it has not been set.static DisplayReturns the default display.intgetDepth()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.intReturns the button dismissal alignment, one ofLEFTorRIGHT.intReturns the longest duration, in milliseconds, between two mouse button clicks that will be considered a double click by the underlying operating system.Returns the current exception handler.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.Return a mapping from layout group to the number of Latin alphabet (a-z) in each groupbooleanReturns true when the high contrast mode is enabled.intReturns the maximum allowed depth of icons on this display, in bits per pixel.Point[]Returns an array containing the recommended icon sizes.(package private) int(package private) intReturn the most Latin keyboard layout group.Returns the single instance of the application menu bar, ornullif there is no application menu bar for the platform.(package private) DialogMonitor[]Returns an array of monitors attached to the device.(package private) voidgetPointerPosition(double[] x, double[] y) Gets the current cursor position relative to the upper left corner of the surface.Returns the primary monitor for that device.final Consumer<RuntimeException> Returns the current exception handler.Shell[]Returns a (possibly empty) array containing all shells which have not been disposed and have the receiver as their display.Gets the synchronizer used by the display.Returns the thread that has invokedsyncExecor null if no such runnable is currently being invoked by the user-interface thread.getSystemColor(int id) Returns the matching standard color for the given constant, which should be one of the color constants specified in classSWT.getSystemCursor(int id) Returns the matching standard platform cursor for the given constant, which should be one of the cursor constants specified in classSWT.getSystemImage(int id) Returns the matching standard platform image for the given constant, which should be one of the icon constants specified in classSWT.Returns the single instance of the system-provided menu for the application, ornullon platforms where no menu is provided for the application.Returns the single instance of the system taskBar or null when there is no system taskBar available for the platform.Returns the single instance of the system tray or null when there is no system tray available for the platform.Returns the user-interface thread for the receiver.booleanReturns a boolean indicating whether a touch-aware input device is attached to the system and is ready for use.(package private) WidgetgetWidget(long handle) (package private) longgetWindowPointerPosition(long window, int[] x, int[] y, int[] mask) Gets the current cursor position relative to the upper left corner of the window.(package private) RectangleReturns the work area, an EWMH property to store the size and position of the screen not covered by dock and panel windows.(package private) long(package private) long(package private) long(package private) Stringgtk_css_create_css_color_string(String background, String foreground, int property) (package private) GdkRGBAgtk_css_parse_background(String css, String precise) This method allows for parsing of background colors from a GTK CSS string.(package private) GdkRGBAgtk_css_parse_foreground(String css, String precise) This method allows for parsing of foreground colors from a GTK CSS string.(package private) GdkRGBAgtk_css_property_to_rgba(String property) This method parses a string representation of a color and returns a GdkRGBA object of that color.(package private) Stringgtk_css_provider_to_string(long provider) (package private) long(package private) StringIn GdkRGBA, values are a double between 0-1.(package private) Stringgtk_widget_class_get_css_name(long handle) Gets the CSS name of the widget provided.(package private) Stringgtk_widget_get_name(long handle) Gets the name of the widget in String format.(package private) longidleProc(long data) protected voidinit()Initializes any internal resources needed by the device.(package private) void(package private) void(package private) void(package private) void(package private) void(package private) voidprivate void(package private) voidinitializeSystemColorsList(long shellContext) (package private) voidinitializeSystemColorsTitle(long shellContext) (package private) void(package private) void(package private) voidinitializeSystemColorsWidget(long shellContext) (package private) void(package private) voidvoidinternal_dispose_GC(long hDC, GCData data) Invokes platform specific functionality to dispose a GC handle.longinternal_new_GC(GCData data) Invokes platform specific functionality to allocate a new GC handle.(package private) static intinversePremultipliedColor(int color, int alpha) Calculates original color from RGBA with premultiplied alpha.(package private) static booleanbooleanReturns whether rescaling of shells at runtime when the DPI scaling of a shell's monitor changes is activated for this device.static booleanReturnstrueif the current OS theme has a dark appearance, else returnsfalse.(package private) static booleanisValidClass(Class<?> clazz) (package private) boolean(package private) booleankeyPressReleaseProc(long controller, int keyval, int keycode, int state, long user_data) (package private) longkeysChangedProc(long keymap, long user_data) 'keys-changed' event handler.(package private) voidleaveProc(long controller, long user_data) Maps a point from one coordinate system to another.Maps a point from one coordinate system to another.Maps a point from one coordinate system to another.Maps a point from one coordinate system to another.(package private) PointmapInPixels(Control from, Control to, int x, int y) (package private) RectanglemapInPixels(Control from, Control to, int x, int y, int width, int height) (package private) RectanglemapInPixels(Control from, Control to, Rectangle rectangle) (package private) longmouseHoverProc(long handle) (package private) longnotifyProc(long object, long param_spec, long user_data) booleanGenerate a low level system event.(package private) void(package private) voidbooleanReads an event from the operating system's event queue, dispatches it appropriately, and returnstrueif there is potentially more work to do, orfalseif the caller can sleep until another event is placed on the event queue.(package private) static voidprotected voidrelease()Releases any internal resources back to the operating system and clears all fields except the device handle.(package private) void(package private) voidvoidremoveFilter(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.(package private) long(package private) voidvoidremoveListener(int eventType, Listener listener) Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.(package private) voidremoveMouseHoverTimeout(long handle) (package private) voidremovePopup(Menu menu) (package private) WidgetremoveWidget(long handle) private static voidrenderAllBackgrounds(long styleContext, long cairo) What user sees is a combination of multiple layers.(package private) static longrendererClassInitProc(long g_class, long class_data) (package private) static longrendererGetPreferredWidthProc(long cell, long handle, long minimun_size, long natural_size) (package private) static longrendererRenderProc(long cell, long cr, long handle, long background_area, long cell_area, long flags) (package private) static longrendererSnapshotProc(long cell, long snapshot, long handle, long background_area, long cell_area, long flags) (package private) void(package private) voidresizeProc(long handle, int width, int height) (package private) booleanrunAsyncMessages(boolean all) (package private) boolean(package private) boolean(package private) boolean(package private) boolean(package private) booleanrunSkin()(package private) void(package private) booleanscrollProc(long controller, double dx, double dy, long user_data) (package private) void(package private) voidsendEvent(EventTable eventTable, Event event) private voidsendJDKInternalEvent(int eventType) private voidsendJDKInternalEvent(int eventType, int detail) does sent event with JDK time(package private) voidsendPostEvent(int eventType) voidSends a SWT.PostExternalEventDispatch event.(package private) voidsendPreEvent(int eventType) voidSends a SWT.PreExternalEventDispatch event.static voidsetAppName(String name) Sets the application name to the argument.static voidsetAppVersion(String version) Sets the application version to the argument.(package private) voidsetCurrentCaret(Caret caret) voidsetCursorLocation(int x, int y) Sets the location of the on-screen pointer relative to the top left corner of the screen.voidsetCursorLocation(Point point) Sets the location of the on-screen pointer relative to the top left corner of the screen.voidSets the application defined, display specific data associated with the receiver, to the argument.voidSets the application defined property of the receiver with the specified name to the given argument.(package private) static void(package private) longsetDirectionProc(long widget, long direction) final voidsetErrorHandler(Consumer<Error> errorHandler) Sets a callback that will be invoked whenever an error is thrown by a listener or external callback function.(package private) voidsetModalDialog(Dialog modalDailog) (package private) voidsetModalShell(Shell shell) booleansetRescalingAtRuntime(boolean activate) Deprecated, for removal: This API element is subject to removal in a future version.this method should not be used as it needs to be called already during instantiation to take proper effectfinal voidsetRuntimeExceptionHandler(Consumer<RuntimeException> runtimeExceptionHandler) Sets a callback that will be invoked whenever an exception is thrown by a listener or external callback function.voidsetSynchronizer(Synchronizer synchronizer) Sets the synchronizer used by the display to be the argument, which can not be null.(package private) longsettingsChangedProc(long settings, long key, long user_data) GtkSettings 'changed' event handler.(package private) longshellMapProc(long handle, long arg0, long user_data) (package private) voidshowIMWindow(Control control) (package private) longsignalProc(long gobject, long arg1, long user_data) (package private) longsizeAllocateProc(long handle, long arg0, long user_data) (package private) longsizeRequestProc(long handle, long arg0, long user_data) booleansleep()Causes the user-interface thread to sleep (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.(package private) voidsnapshotDrawProc(long handle, long snapshot) (package private) GdkRGBAstyleContextEstimateBackgroundColor(long context, int state) Background in GTK theme can be more complex then just solid color: 1) Due to 'background-image', 'background-position', 'background-repeat', etc.(package private) GdkRGBAstyleContextGetColor(long context, int flag) <T, E extends Exception>
TsyncCall(SwtCallable<T, E> callable) Calls the callable on the user-interface thread at the next reasonable opportunity, and returns the its result from this method.voidCauses therun()method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.voidCauses therun()method of the runnable to be invoked by the user-interface thread after the specified number of milliseconds have elapsed.(package private) longtimerProc(long i) (package private) GdkRGBAThis method converts from RGB to HSV, from HSV to HSL (including brightness), from HSL back to HSV and from HSV back to RGB.(package private) static inttranslateKey(int key) (package private) static intuntranslateKey(int key) voidupdate()Forces all outstanding paint requests for the display to be processed before this method returns.voidwake()If the receiver's user-interface thread wassleeping, causes it to be awakened and start running again.(package private) void(package private) voidwindowActiveProc(long handle, long user_data) (package private) longwindowProc(long handle, long user_data) (package private) longwindowProc(long handle, long arg0, long user_data) (package private) longwindowProc(long handle, long arg0, long arg1, long user_data) (package private) longwindowProc(long handle, long arg0, long arg1, long arg2, long user_data) (package private) longwindowProc(long handle, long arg0, long arg1, long arg2, long arg3, long user_data) (package private) longwindowTimerProc(long handle) Methods inherited from class Device
dispose, getDeviceData, getDeviceZoom, getDPI, getFontList, getSystemFont, getWarnings, isDisposed, isTracking, loadFont, setTracking, setWarningsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Drawable
isAutoScalable
-
Field Details
-
SLOT_IN_USE
private static final int SLOT_IN_USE- See Also:
-
LAST_TABLE_INDEX
private static final int LAST_TABLE_INDEX- See Also:
-
gdkEventCount
int gdkEventCount -
gdkEvents
long[] gdkEvents -
gdkEventWidgets
Widget[] gdkEventWidgets -
dispatchEvents
int[] dispatchEvents -
eventQueue
Event[] eventQueue -
fds
long fds -
allocated_nfds
int allocated_nfds -
wake
boolean wake -
windowSizeSet
boolean windowSizeSet -
max_priority
int[] max_priority -
timeout
int[] timeout -
eventCallback
Callback eventCallback -
eventProc
long eventProc -
windowProc2
long windowProc2 -
windowProc3
long windowProc3 -
windowProc4
long windowProc4 -
windowProc5
long windowProc5 -
windowProc6
long windowProc6 -
changeValueProc
long changeValueProc -
snapshotDrawProc
long snapshotDrawProc -
keyPressReleaseProc
long keyPressReleaseProc -
focusProc
long focusProc -
windowActiveProc
long windowActiveProc -
enterMotionProc
long enterMotionProc -
leaveProc
long leaveProc -
scrollProc
long scrollProc -
resizeProc
long resizeProc -
activateProc
long activateProc -
gesturePressReleaseProc
long gesturePressReleaseProc -
notifyProc
long notifyProc -
computeSizeProc
long computeSizeProc -
windowCallback2
Callback windowCallback2 -
windowCallback3
Callback windowCallback3 -
windowCallback4
Callback windowCallback4 -
windowCallback5
Callback windowCallback5 -
windowCallback6
Callback windowCallback6 -
changeValue
Callback changeValue -
snapshotDraw
Callback snapshotDraw -
keyPressReleaseCallback
Callback keyPressReleaseCallback -
focusCallback
Callback focusCallback -
windowActiveCallback
Callback windowActiveCallback -
enterMotionCallback
Callback enterMotionCallback -
computeSizeCallback
Callback computeSizeCallback -
scrollCallback
Callback scrollCallback -
leaveCallback
Callback leaveCallback -
resizeCallback
Callback resizeCallback -
activateCallback
Callback activateCallback -
gesturePressReleaseCallback
Callback gesturePressReleaseCallback -
notifyCallback
Callback notifyCallback -
eventTable
EventTable eventTable -
filterTable
EventTable filterTable -
APP_NAME
-
APP_VERSION
-
DISPATCH_EVENT_KEY
- See Also:
-
ADD_WIDGET_KEY
- See Also:
-
EXTERNAL_EVENT_LOOP_KEY
- See Also:
-
closures
long[] closures -
closuresProc
long[] closuresProc -
closuresCount
int[] closuresCount -
signalIds
int[] signalIds -
shellMapProcClosure
long shellMapProcClosure -
externalEventLoop
boolean externalEventLoop -
indexTable
int[] indexTable -
freeSlot
int freeSlot -
lastHandle
long lastHandle -
lastWidget
Widget lastWidget -
widgetTable
Widget[] widgetTable -
GROW_SIZE
static final int GROW_SIZE- See Also:
-
SWT_OBJECT_INDEX
static final int SWT_OBJECT_INDEX -
SWT_OBJECT_INDEX1
static final int SWT_OBJECT_INDEX1 -
SWT_OBJECT_INDEX2
static final int SWT_OBJECT_INDEX2 -
modalShells
Shell[] modalShells -
modalDialog
Dialog modalDialog -
GET_MODAL_DIALOG
- See Also:
-
SET_MODAL_DIALOG
- See Also:
-
focusEvent
int focusEvent -
focusControl
Control focusControl -
activeShell
Shell activeShell -
activePending
boolean activePending -
ignoreActivate
boolean ignoreActivate -
ignoreFocus
boolean ignoreFocus -
tracker
Tracker tracker -
imControl
Control imControl -
preeditWindow
long preeditWindow -
preeditLabel
long preeditLabel -
synchronizer
Synchronizer synchronizer -
runtimeExceptionHandler
Consumer<RuntimeException> runtimeExceptionHandler -
errorHandler
-
thread
Thread thread -
sessionManagerDBus
SessionManagerDBus sessionManagerDBus -
sessionManagerListener
Display.SessionManagerListener sessionManagerListener -
disposeList
Runnable[] disposeList -
layoutDeferred
Composite[] layoutDeferred -
layoutDeferredCount
int layoutDeferredCount -
tray
Tray tray -
currentTrayItem
TrayItem currentTrayItem -
timerIds
int[] timerIds -
timerList
Runnable[] timerList -
timerCallback
Callback timerCallback -
timerProc
long timerProc -
windowTimerCallback
Callback windowTimerCallback -
windowTimerProc
long windowTimerProc -
currentCaret
Caret currentCaret -
caretCallback
Callback caretCallback -
caretId
int caretId -
caretProc
long caretProc -
mnemonicControl
Control mnemonicControl -
mouseHoverId
int mouseHoverId -
mouseHoverHandle
long mouseHoverHandle -
mouseHoverProc
long mouseHoverProc -
mouseHoverCallback
Callback mouseHoverCallback -
sizeAllocateProc
long sizeAllocateProc -
sizeAllocateCallback
Callback sizeAllocateCallback -
sizeRequestProc
long sizeRequestProc -
sizeRequestCallback
Callback sizeRequestCallback -
shellMapProc
long shellMapProc -
shellMapCallback
Callback shellMapCallback -
idleProc
long idleProc -
idleHandle
int idleHandle -
idleCallback
Callback idleCallback -
ADD_IDLE_PROC_KEY
- See Also:
-
REMOVE_IDLE_PROC_KEY
- See Also:
-
idleLock
Object idleLock -
idleNeeded
boolean idleNeeded -
cellDataProc
long cellDataProc -
cellDataCallback
Callback cellDataCallback -
setDirectionProc
long setDirectionProc -
setDirectionCallback
Callback setDirectionCallback -
GET_DIRECTION_PROC_KEY
- See Also:
-
emissionProc
long emissionProc -
emissionProcCallback
Callback emissionProcCallback -
GET_EMISSION_PROC_KEY
- See Also:
-
allChildrenProc
long allChildrenProc -
allChildren
long allChildren -
allChildrenCallback
Callback allChildrenCallback -
signalProc
long signalProc -
signalCallback
Callback signalCallback -
shellHandle
long shellHandle -
settingsChanged
boolean settingsChanged -
runSettings
boolean runSettings -
STYLE_UPDATED
static final int STYLE_UPDATED- See Also:
-
entrySelectOnFocus
boolean entrySelectOnFocus -
currentControl
Control currentControl -
checkIfEventProc
long checkIfEventProc -
checkIfEventCallback
Callback checkIfEventCallback -
flushWindow
long flushWindow -
flushAll
boolean flushAll -
flushRect
GdkRectangle flushRect -
exposeEvent
XExposeEvent exposeEvent -
flushData
long[] flushData -
errorImage
Image errorImage -
infoImage
Image infoImage -
questionImage
Image questionImage -
warningImage
Image warningImage -
cursors
Cursor[] cursors -
resources
Resource[] resources -
RESOURCE_SIZE
static final int RESOURCE_SIZE- See Also:
-
COLOR_WIDGET_DARK_SHADOW_RGBA
GdkRGBA COLOR_WIDGET_DARK_SHADOW_RGBA -
COLOR_WIDGET_NORMAL_SHADOW_RGBA
GdkRGBA COLOR_WIDGET_NORMAL_SHADOW_RGBA -
COLOR_WIDGET_LIGHT_SHADOW_RGBA
GdkRGBA COLOR_WIDGET_LIGHT_SHADOW_RGBA -
COLOR_WIDGET_HIGHLIGHT_SHADOW_RGBA
GdkRGBA COLOR_WIDGET_HIGHLIGHT_SHADOW_RGBA -
COLOR_WIDGET_BACKGROUND_RGBA
GdkRGBA COLOR_WIDGET_BACKGROUND_RGBA -
COLOR_WIDGET_FOREGROUND_RGBA
GdkRGBA COLOR_WIDGET_FOREGROUND_RGBA -
COLOR_WIDGET_BORDER_RGBA
GdkRGBA COLOR_WIDGET_BORDER_RGBA -
COLOR_LIST_FOREGROUND_RGBA
GdkRGBA COLOR_LIST_FOREGROUND_RGBA -
COLOR_LIST_BACKGROUND_RGBA
GdkRGBA COLOR_LIST_BACKGROUND_RGBA -
COLOR_LIST_SELECTION_RGBA
GdkRGBA COLOR_LIST_SELECTION_RGBA -
COLOR_LIST_SELECTION_TEXT_RGBA
GdkRGBA COLOR_LIST_SELECTION_TEXT_RGBA -
COLOR_LIST_SELECTION_INACTIVE_RGBA
GdkRGBA COLOR_LIST_SELECTION_INACTIVE_RGBA -
COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA
GdkRGBA COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA -
COLOR_INFO_BACKGROUND_RGBA
GdkRGBA COLOR_INFO_BACKGROUND_RGBA -
COLOR_INFO_FOREGROUND_RGBA
GdkRGBA COLOR_INFO_FOREGROUND_RGBA -
COLOR_LINK_FOREGROUND_RGBA
GdkRGBA COLOR_LINK_FOREGROUND_RGBA -
COLOR_TITLE_FOREGROUND_RGBA
GdkRGBA COLOR_TITLE_FOREGROUND_RGBA -
COLOR_TITLE_BACKGROUND_RGBA
GdkRGBA COLOR_TITLE_BACKGROUND_RGBA -
COLOR_TITLE_BACKGROUND_GRADIENT_RGBA
GdkRGBA COLOR_TITLE_BACKGROUND_GRADIENT_RGBA -
COLOR_TITLE_INACTIVE_FOREGROUND_RGBA
GdkRGBA COLOR_TITLE_INACTIVE_FOREGROUND_RGBA -
COLOR_TITLE_INACTIVE_BACKGROUND_RGBA
GdkRGBA COLOR_TITLE_INACTIVE_BACKGROUND_RGBA -
COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT_RGBA
GdkRGBA COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT_RGBA -
COLOR_WIDGET_DISABLED_FOREGROUND_RGBA
GdkRGBA COLOR_WIDGET_DISABLED_FOREGROUND_RGBA -
COLOR_TEXT_DISABLED_BACKGROUND_RGBA
GdkRGBA COLOR_TEXT_DISABLED_BACKGROUND_RGBA -
COLOR_TOGGLE_BUTTON_FOREGROUND_RGBA
GdkRGBA COLOR_TOGGLE_BUTTON_FOREGROUND_RGBA -
colorList
-
SWT_COLOR_LIST_SELECTION_TEXT_INACTIVE
final int SWT_COLOR_LIST_SELECTION_TEXT_INACTIVE- See Also:
-
SWT_COLOR_LIST_SELECTION_INACTIVE
final int SWT_COLOR_LIST_SELECTION_INACTIVE- See Also:
-
themeName
The name of the current theme, including the theme named by GTK_THEME. -
themeDark
static boolean themeDarkTrue if the current theme is dark. This includes the theme set in GTK_THEME. -
colorPattern
-
popups
Menu[] popups -
clickCount
int clickCount -
INNER_BORDER
static final int INNER_BORDER- See Also:
-
lastEventTime
int lastEventTime -
lastUserEventTime
int lastUserEventTime -
pangoLayoutNewProc
long pangoLayoutNewProc -
pangoFontFamilyNewProc
long pangoFontFamilyNewProc -
pangoFontFaceNewProc
long pangoFontFaceNewProc -
imContextNewProc
long imContextNewProc -
printerOptionWidgetNewProc
long printerOptionWidgetNewProc -
resizeLocationX
double resizeLocationX -
resizeLocationY
double resizeLocationY -
resizeBoundsX
int resizeBoundsX -
resizeBoundsY
int resizeBoundsY -
resizeBoundsWidth
int resizeBoundsWidth -
resizeBoundsHeight
int resizeBoundsHeight -
resizeMode
int resizeMode -
fixed_type
static long fixed_type -
text_renderer_type
static long text_renderer_type -
pixbuf_renderer_type
static long pixbuf_renderer_type -
toggle_renderer_type
static long toggle_renderer_type -
text_renderer_info_ptr
static long text_renderer_info_ptr -
pixbuf_renderer_info_ptr
static long pixbuf_renderer_info_ptr -
toggle_renderer_info_ptr
static long toggle_renderer_info_ptr -
rendererClassInitCallback
-
rendererRenderCallback
-
rendererSnapshotCallback
-
rendererGetPreferredWidthCallback
-
rendererClassInitProc
static long rendererClassInitProc -
rendererRenderProc
static long rendererRenderProc -
rendererSnapshotProc
static long rendererSnapshotProc -
rendererGetPreferredWidthProc
static long rendererGetPreferredWidthProc -
KeyTable
static final int[][] KeyTable -
cachedModifierState
int cachedModifierState -
latinKeyGroup
private int latinKeyGroup -
groupKeysCount
-
keysChangedProc
long keysChangedProc -
keysChangedCallback
Callback keysChangedCallback -
settingsChangedProc
long settingsChangedProc -
settingsChangedCallback
Callback settingsChangedCallback -
Default
-
Displays
-
skinList
Widget[] skinList -
skinCount
int skinCount -
PACKAGE_PREFIX
- See Also:
-
GTK3_MAJOR
static final int GTK3_MAJOR- See Also:
-
GTK3_MINOR
static final int GTK3_MINOR- See Also:
-
GTK3_MICRO
static final int GTK3_MICRO- See Also:
-
GTK4_MAJOR
static final int GTK4_MAJOR- See Also:
-
GTK4_MINOR
static final int GTK4_MINOR- See Also:
-
GTK4_MICRO
static final int GTK4_MICRO- See Also:
-
data
Object data -
keys
String[] keys -
values
Object[] values -
TRIM_NONE
static final int TRIM_NONE- See Also:
-
TRIM_BORDER
static final int TRIM_BORDER- See Also:
-
TRIM_RESIZE
static final int TRIM_RESIZE- See Also:
-
TRIM_TITLE_BORDER
static final int TRIM_TITLE_BORDER- See Also:
-
TRIM_TITLE_RESIZE
static final int TRIM_TITLE_RESIZE- See Also:
-
TRIM_TITLE
static final int TRIM_TITLE- See Also:
-
trimWidths
int[] trimWidths -
trimHeights
int[] trimHeights -
ignoreTrim
boolean ignoreTrim -
windowManager
String windowManager
-
-
Constructor Details
-
Display
public Display()Constructs a new instance of this class.Note: The resulting display is marked as the current display. If this is the first display which has been constructed since the application started, it is also marked as the default display.
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if called from a thread that already created an existing display
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
- See Also:
-
Display
Constructs a new instance of this class using the parameter.- Parameters:
data- the device data
-
-
Method Details
-
setDevice
-
addFilter
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 classSWT. When the event does occur, the listener is notified by sending it thehandleEvent()message.Setting the type of an event to
SWT.Nonefrom within thehandleEvent()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.- Parameters:
eventType- the type of event to listen forlistener- the listener which should be notified when the event occurs- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.0
- See Also:
-
addLayoutDeferred
-
addGdkEvent
void addGdkEvent(long event) -
addIdleProc
void addIdleProc() -
addListener
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 classSWT. When the event does occur in the display, the listener is notified by sending it thehandleEvent()message.- Parameters:
eventType- the type of event to listen forlistener- the listener which should be notified when the event occurs- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.0
- See Also:
-
gdbus_init_methods
private void gdbus_init_methods()Handle gdbus on 'org.eclipse.swt' DBus session. E.g equinox launcher passes files/urls to SWT via gdbus. "./eclipse myFile" or "./eclipse http://www.google.com" Only one SWT instance can hold the unique and well-known name at one time. We construct the name as org.eclipse.swt.NAME (e.g. org.eclipse.swt.Eclipse), where NAME is derived from the application executable but may be changed using the command-line argument -name. For equinox launcher, See eclipseGtk.c:gtkPlatformJavaSystemProperties -
allChildrenProc
long allChildrenProc(long widget, long recurse) -
addMouseHoverTimeout
void addMouseHoverTimeout(long handle) -
addPopup
-
addSkinnableWidget
-
addWidget
-
asyncExec
Causes therun()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. Specifyingnullas the runnable simply wakes the user-interface thread when run.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.
- Parameters:
runnable- code to run on the user-interface thread ornull- Throws:
SWTException-- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
execute
Executes the given runnable in the user-interface thread of this Display.- If the calling thread is the user-interface thread of this display it is
executed immediately and the method returns after the command has run, as with
the method
syncExec(Runnable). - In all other cases the
run()method of the runnable is asynchronously executed as with the methodasyncExec(Runnable)at the next reasonable opportunity. The caller of this method continues to run in parallel, and is not notified when the runnable has completed.
This can be used in cases where one want to execute some piece of code that should be guaranteed to run in the user-interface thread regardless of the current thread.
Note that at the time the runnable is invoked, widgets that have the receiver as their display may have been disposed. Therefore, it is advised to check for this case inside the runnable before accessing the widget.
- Specified by:
executein interfaceExecutor- Parameters:
runnable- the runnable to execute in the user-interface thread, nevernull- Throws:
RejectedExecutionException- if this task cannot be accepted for executionNullPointerException- if runnable is null
- If the calling thread is the user-interface thread of this display it is
executed immediately and the method returns after the command has run, as with
the method
-
beep
public void beep()Causes the system hardware to emit a short sound (if it supports this capability).- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
cellDataProc
long cellDataProc(long tree_column, long cell, long tree_model, long iter, long data) -
checkDevice
protected void checkDevice()Description copied from class:DeviceThrows anSWTExceptionif 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 should be called by device implementors to enforce the standard SWT invariants.Currently, it is an error to invoke any method (other than
isDisposed()anddispose()) on a device that has had itsdispose()method called.In future releases of SWT, there may be more or fewer error checks and exceptions may be thrown for different reasons.
- Overrides:
checkDevicein classDevice
-
checkDisplay
-
checkIfEventProc
long checkIfEventProc(long display, long xEvent, long userData) -
checkSubclass
protected void checkSubclass()Checks that this class can be subclassed.IMPORTANT: See the comment in
Widget.checkSubclass().- Throws:
SWTException-- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
- See Also:
-
clearModal
-
close
public void close()Requests that the connection between SWT and the underlying operating system be closed.- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.0
- See Also:
-
create
Creates the device in the operating system. If the device does not have a handle, this method may do nothing depending on the device.This method is called before
init. -
checkIMModule
void checkIMModule()Check if the XIM module is present and generates a warning for potential graphical issues if GTK_IM_MODULE=xim is detected. See Bug 517671. Additionally, this method enforces IBus as the input method for SWT-GTK on GNOME. This is because GNOME forces IBus by default, so any discrepancy can cause crashes on newer versions of GTK3. -
checkAndSetThemeDetails
Sets the org.eclipse.swt.internal.gtk.theme value with the current GTK theme name. Checks if the current theme SWT is running with is dark or not. This includes checking the GTK_THEME environment variable, the theme name, and GSettings.- Parameters:
themeName- the full name of the current theme SWT is running with- Returns:
- true if the current theme is dark
-
createDisplay
-
findLatinKeyGroup
private int findLatinKeyGroup()Determine key group of Latin layout, and update the layout group to key count map. If there are multiple Latin keyboard layout group, return the first one.- Returns:
- the most Latin keyboard layout group (i.e. group holding the max number of Latin alphabet keys)
-
getLatinKeyGroup
int getLatinKeyGroup()Return the most Latin keyboard layout group. -
getGroupKeysCount
-
keysChangedProc
long keysChangedProc(long keymap, long user_data) 'keys-changed' event handler. Updates the most Latin keyboard layout group field. -
settingsChangedProc
long settingsChangedProc(long settings, long key, long user_data) GtkSettings 'changed' event handler. -
createImage
-
deregister
-
destroy
-
destroyDisplay
void destroyDisplay() -
emissionProc
long emissionProc(long ihint, long n_param_values, long param_values, long data) -
findDisplay
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. Specifyingnullas the thread will returnnullfor the display.- Parameters:
thread- the user-interface thread- Returns:
- the display for the given thread
-
disposeExec
Causes therun()method of the runnable to be invoked by the user-interface thread just before the receiver is disposed. Specifying anullrunnable is ignored.- Parameters:
runnable- code to run at dispose time.- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
error
void error(int code) Does whatever display specific cleanup is required, and then uses the code inSWTError.errorto handle the error.- Parameters:
code- the descriptive error code- See Also:
-
eventProc
long eventProc(long event, long data) -
findWidget
Given the operating system handle for a widget, returns the instance of theWidgetsubclass which represents it in the currently running application, if such exists, or null if no matching widget can be found.IMPORTANT: This method should not be called from application code. The arguments are platform-specific.
- Parameters:
handle- the handle for the widget- Returns:
- the SWT widget that the handle represents
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
findWidget
Given the operating system handle for a widget, and widget-specific id, returns the instance of theWidgetsubclass which represents the handle/id pair in the currently running application, if such exists, or null if no matching widget can be found.IMPORTANT: This method should not be called from application code. The arguments are platform-specific.
- Parameters:
handle- the handle for the widgetid- the id for the subwidget (usually an item)- Returns:
- the SWT widget that the handle/id pair represents
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.1
-
findWidget
Given a widget and a widget-specific id, returns the instance of theWidgetsubclass which represents the widget/id pair in the currently running application, if such exists, or null if no matching widget can be found.- Parameters:
widget- the widgetid- the id for the subwidget (usually an item)- Returns:
- the SWT subwidget (usually an item) that the widget/id pair represents
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.3
-
rendererClassInitProc
static long rendererClassInitProc(long g_class, long class_data) -
snapshotDrawProc
void snapshotDrawProc(long handle, long snapshot) -
rendererGetPreferredWidthProc
static long rendererGetPreferredWidthProc(long cell, long handle, long minimun_size, long natural_size) -
rendererRenderProc
static long rendererRenderProc(long cell, long cr, long handle, long background_area, long cell_area, long flags) -
rendererSnapshotProc
static long rendererSnapshotProc(long cell, long snapshot, long handle, long background_area, long cell_area, long flags) -
flushExposes
void flushExposes(long window, boolean all) -
getActiveShell
Returns the currently activeShell, or null if no shell belonging to the currently running application is active.- Returns:
- the active shell or null
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
getBounds
Returns a rectangle describing the receiver's size and location. Note that on multi-monitor systems the origin can be negative.- Overrides:
getBoundsin classDevice- Returns:
- the bounding rectangle
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
getClientArea
Returns a rectangle which describes the area of the receiver which is capable of displaying data.- Overrides:
getClientAreain classDevice- Returns:
- the client area
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
getBoundsInPixels
Rectangle getBoundsInPixels() -
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.- Returns:
- the current display
-
getCaretBlinkTime
int getCaretBlinkTime() -
getClosure
long getClosure(int id) -
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.- Returns:
- the control under the cursor or
null - Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
filterEvent
-
filters
boolean filters(int eventType) -
getCursorLocation
Returns the location of the on-screen pointer relative to the top left corner of the screen.- Returns:
- the cursor location
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
getCursorSizes
Returns an array containing the recommended cursor sizes.- Returns:
- the array of cursor sizes
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.0
-
getData
Returns the application defined property of the receiver with the specified name, or null if it has not been set.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
disposeExec()handler which does so.- Parameters:
key- the name of the property- Returns:
- the value of the property or null if it has not been set
- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the key is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
getData
Returns the application defined, display specific data associated with the receiver, or null if it has not been set. The display specific data is a single, unnamed field that is stored with every display.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
disposeExec()handler which does so.- Returns:
- the display specific data
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
gtk_fixed_get_type
long gtk_fixed_get_type() -
gtk_cell_renderer_text_get_type
long gtk_cell_renderer_text_get_type() -
gtk_cell_renderer_pixbuf_get_type
long gtk_cell_renderer_pixbuf_get_type() -
gtk_cell_renderer_toggle_get_type
long gtk_cell_renderer_toggle_get_type() -
gtk_css_create_css_color_string
-
gtk_css_parse_background
This method allows for parsing of background colors from a GTK CSS string. It allows for specific search input, such as a selector or tag, or for parsing the first (and usually only) background color in a given GtkCssProvider. For example: given the string GtkWidget {background-color: rgba(255, 0, 0, 255);} this method will return a GdkRGBA object with the color red. Supported formats include "background-color" and just "background".- Parameters:
css- a CSS being parsedprecise- a String representation of a selector to search for, or NULL if the entire GtkCssProvider is to be parsed- Returns:
- a GdkRGBA object representing the background color, or COLOR_WIDGET_BACKGROUND if the background color could not be parsed or isn't set
-
gtk_css_provider_to_string
-
gtk_css_parse_foreground
This method allows for parsing of foreground colors from a GTK CSS string. It allows for specific search input, such as a selector or tag, or for parsing the first (and usually only) foreground color in a given GtkCssProvider. For example: given the string GtkWidget {color: rgba(255, 0, 0, 255);} this method will return a GdkRGBA object with the color red.- Parameters:
css- a CSS representation of the gtk themeprecise- a String representation of a selector to search for, or NULL if the entire GtkCssProvider is to be parsed- Returns:
- a GdkRGBA object representing the foreground color or COLOR_WIDGET_FOREGROUND if the foreground color could not be parsed or isn't set
-
gtk_css_property_to_rgba
This method parses a string representation of a color and returns a GdkRGBA object of that color. Supported formats: -a standard X11 color -a hex value in the form "#rgb", "#rrggbb", "#rrrgggbbb" or "rrrrggggbbbb" -an RGB color in the for "rgb(r,g,b)" -an RGBA color in the form "rgba(r,g,b,a)"- Parameters:
property- a String representation of the color- Returns:
- a GdkRGBA object representing the color, or transparent (empty GdkRGBA) if the color could not be parsed
-
gtk_rgba_to_css_string
In GdkRGBA, values are a double between 0-1. In CSS, values are integers between 0-255 for r, g, and b. Alpha is still a double between 0-1. The final CSS format is: rgba(int, int, int, double) Due to this, there is a slight loss of precision. Setting/getting with CSS *might* yield slight differences.- Parameters:
rgba- a GdkRGBA object containing the color to be parsed or NULL- Returns:
- a String representation of the color or COLOR_WIDGET_BACKGROUND if NULL is specified as a parameter
-
gtk_widget_get_name
Gets the name of the widget in String format.- Parameters:
handle- a pointer to the GtkWidget resource- Returns:
- a String representation of the widget's name
-
gtk_widget_class_get_css_name
Gets the CSS name of the widget provided. This only works on GTK3.20+.- Parameters:
handle- a pointer to the GtkWidget resource- Returns:
- a String representation of the widget's CSS name
-
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.- Returns:
- the default display
-
isValidClass
-
getMenuBar
Returns the single instance of the application menu bar, ornullif there is no application menu bar for the platform.- Returns:
- the application menu bar, or
null - Throws:
SWTException-- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.7
-
getDismissalAlignment
public int getDismissalAlignment()Returns the button dismissal alignment, one ofLEFTorRIGHT. 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 isLEFT, the button ordering should be OK/CANCEL. When button dismissal alignment isRIGHT, the button ordering should be CANCEL/OK.- Returns:
- the button dismissal order
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.1
-
getDoubleClickTime
public int getDoubleClickTime()Returns the longest duration, in milliseconds, between two mouse button clicks that will be considered a double click by the underlying operating system.- Returns:
- the double click time
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
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.- Returns:
- the focus control or
null - Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
getHighContrast
public boolean getHighContrast()Returns true when the high contrast mode is enabled. Otherwise, false is returned.Note: This operation is a hint and is not supported on platforms that do not have this concept.
- Returns:
- the high contrast mode
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.0
-
getDepth
public int getDepth()Description copied from class:DeviceReturns 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. -
getIconDepth
public 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.- Returns:
- the maximum icon depth
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
getIconSizes
Returns an array containing the recommended icon sizes.- Returns:
- the array of icon sizes
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.0
- See Also:
-
isSystemDarkTheme
public static boolean isSystemDarkTheme()Returnstrueif the current OS theme has a dark appearance, else returnsfalse.Note: This operation is a hint and is not supported on platforms that do not have this concept.
Note: Windows 10 onwards users can separately configure the theme for OS and Application level and this can be read from the Windows registry. Since the application needs to honor the application level theme, this API reads the Application level theme setting.
- Returns:
trueif the current OS theme has a dark appearance, else returnsfalse.- Since:
- 3.112
-
getLastEventTime
int getLastEventTime() -
getModalDialog
Dialog getModalDialog() -
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. -
getMonitors
Returns an array of monitors attached to the device.- Returns:
- the array of monitors
- Since:
- 3.0
-
getPrimaryMonitor
Returns the primary monitor for that device.- Returns:
- the primary monitor
- Since:
- 3.0
-
getShells
Returns a (possibly empty) array containing all shells which have not been disposed and have the receiver as their display.- Returns:
- the receiver's shells
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
getSynchronizer
Gets the synchronizer used by the display.- Returns:
- the receiver's synchronizer
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.4
-
getSyncThread
Returns the thread that has invokedsyncExecor null if no such runnable is currently being invoked by the user-interface thread.Note: If a runnable invoked by asyncExec is currently running, this method will return null.
- Returns:
- the receiver's sync-interface thread
- Throws:
SWTException-- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
getSystemColor
Returns the matching standard color for the given constant, which should be one of the color constants specified in classSWT. 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.- Overrides:
getSystemColorin classDevice- Parameters:
id- the color constant- Returns:
- the matching color
- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
getSystemCursor
Returns the matching standard platform cursor for the given constant, which should be one of the cursor constants specified in classSWT. This cursor should not be free'd because it was allocated by the system, not the application. A value ofnullwill be returned if the supplied constant is not an SWT cursor constant.- Parameters:
id- the SWT cursor constant- Returns:
- the corresponding cursor or
null - Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.0
- See Also:
-
getSystemImage
Returns the matching standard platform image for the given constant, which should be one of the icon constants specified in classSWT. This image should not be free'd because it was allocated by the system, not the application. A value ofnullwill 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.- Parameters:
id- the SWT icon constant- Returns:
- the corresponding image or
null - Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.0
- See Also:
-
getSystemMenu
Returns the single instance of the system-provided menu for the application, ornullon platforms where no menu is provided for the application.- Returns:
- the system menu, or
null - Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.7
-
toGdkRGBA
This method converts from RGB to HSV, from HSV to HSL (including brightness), from HSL back to HSV and from HSV back to RGB. In short (ordered 1 - 5): 1. RGB -> HSV 2. HSV -> HSL 3. HSL -> HSL (with brightness) 4. HSL -> HSV 5. HSV -> RGB NOTE: hue, saturation, and luminosity are values from 0 to 1. Brightness can be any number from 0 to Double.MAX_VALUE, but is only practical when luminosity and saturation are invalid input: '<'= 1. The higher the brightness, the lighter a color gets. Lighter here means "more white", i.e. saturation and luminosity values of 1.0 means the color is pure white. More info on the conversion can be found here: https://en.wikipedia.org/wiki/HSL_and_HSV http://codeitdown.com/hsl-hsb-hsv-color/- Parameters:
rgba- the source GdkRGBA from which RGB values are copied frombrightness- a value between 0 and Double.MAX_VALUE which modifies the brightness of saturation and luminosity- Returns:
- GdkRGBA object with calculated RGB values
-
inversePremultipliedColor
static int inversePremultipliedColor(int color, int alpha) Calculates original color from RGBA with premultiplied alpha. NOTE: Calculating inverse gives a range of possible colors due to rounding that occurs with integer calculations. However, alpha-blend formula only has the multiplied component, so all of those inverses are equivalent. -
renderAllBackgrounds
private static void renderAllBackgrounds(long styleContext, long cairo) What user sees is a combination of multiple layers. This is only important when top layer is semi-transparent. -
styleContextEstimateBackgroundColor
Background in GTK theme can be more complex then just solid color: 1) Due to 'background-image', 'background-position', 'background-repeat', etc. Example: 'tooltip' in 'Ambiance' theme uses 'background-image'. 2) If background is semi-transparent, user actually sees a combination of layers. Example: 'tooltip' in 'HighContrast' theme has transparent label. Both problems are solved by drawing to a temporary image and getting the color of the pixel in the middle. -
copyRGBA
-
initializeSystemColors
void initializeSystemColors() -
initializeSystemColorsWidget
void initializeSystemColorsWidget(long shellContext) -
initializeSystemColorsList
void initializeSystemColorsList(long shellContext) -
initializeSystemColorsTitle
void initializeSystemColorsTitle(long shellContext) -
initializeSystemColorsLink
private void initializeSystemColorsLink() -
initializeSystemColorsTooltip
void initializeSystemColorsTooltip() -
initializeSystemColorsToggleButton
void initializeSystemColorsToggleButton() -
initializeSystemColorsDisabled
void initializeSystemColorsDisabled() -
styleContextGetColor
-
getSystemTaskBar
Returns the single instance of the system taskBar or null when there is no system taskBar available for the platform.- Returns:
- the system taskBar or
null - Throws:
SWTException-- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.6
-
getSystemTray
Returns the single instance of the system tray or null when there is no system tray available for the platform.- Returns:
- the system tray or
null - Throws:
SWTException-- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.0
-
getThread
Returns the user-interface thread for the receiver.- Returns:
- the receiver's user-interface thread
- Throws:
SWTException-- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
-
getTouchEnabled
public boolean getTouchEnabled()Returns a boolean indicating whether a touch-aware input device is attached to the system and is ready for use.- Returns:
trueif a touch-aware input device is detected, orfalseotherwise- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.7
-
getWidget
-
idleProc
long idleProc(long data) -
init
-
initializeCallbacks
void initializeCallbacks() -
initializeNamedColorList
void initializeNamedColorList() -
initializeSubclasses
void initializeSubclasses() -
initializeSystemSettings
void initializeSystemSettings() -
initializeWidgetTable
void initializeWidgetTable() -
initializeSessionManager
void initializeSessionManager() -
extractFreeGError
Helper method to extract GError messages. Only call if the pointer is valid (i.e. non-zero).- Parameters:
errorPtr- pointer to the GError- Returns:
- a String representing the error message that was set
-
releaseSessionManager
void releaseSessionManager() -
internal_dispose_GC
Invokes platform specific functionality to dispose a GC handle.IMPORTANT: This method is not part of the public API for
Display. 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.- Specified by:
internal_dispose_GCin interfaceDrawable- Specified by:
internal_dispose_GCin classDevice- Parameters:
hDC- the platform specific GC handledata- the platform specific GC data
-
internal_new_GC
Invokes platform specific functionality to allocate a new GC handle.IMPORTANT: This method is not part of the public API for
Display. 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.- Specified by:
internal_new_GCin interfaceDrawable- Specified by:
internal_new_GCin classDevice- Parameters:
data- the platform specific GC data- Returns:
- the platform specific GC handle
- Throws:
SWTException-- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
SWTError-- ERROR_NO_HANDLES if a handle could not be obtained for gc creation
-
isValidThread
boolean isValidThread() -
map
Maps a point from one coordinate system to another. When the control is null, coordinates are mapped to the display.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. Mapping a point that is the origin of a rectangle and then adding the width and height is not equivalent to mapping the rectangle. When one control is mirrored and the other is not, adding the width and height to a point that was mapped causes the rectangle to extend in the wrong direction. Mapping the entire rectangle instead of just one point causes both the origin and the corner of the rectangle to be mapped.
- Parameters:
from- the sourceControlornullto- the destinationControlornullpoint- to be mapped- Returns:
- point with mapped coordinates
- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the point is null
- ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.1.2
-
map
Maps a point from one coordinate system to another. When the control is null, coordinates are mapped to the display.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. Mapping a point that is the origin of a rectangle and then adding the width and height is not equivalent to mapping the rectangle. When one control is mirrored and the other is not, adding the width and height to a point that was mapped causes the rectangle to extend in the wrong direction. Mapping the entire rectangle instead of just one point causes both the origin and the corner of the rectangle to be mapped.
- Parameters:
from- the sourceControlornullto- the destinationControlornullx- coordinates to be mappedy- coordinates to be mapped- Returns:
- point with mapped coordinates
- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.1.2
-
mapInPixels
-
map
Maps a point from one coordinate system to another. When the control is null, coordinates are mapped to the display.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. Mapping a point that is the origin of a rectangle and then adding the width and height is not equivalent to mapping the rectangle. When one control is mirrored and the other is not, adding the width and height to a point that was mapped causes the rectangle to extend in the wrong direction. Mapping the entire rectangle instead of just one point causes both the origin and the corner of the rectangle to be mapped.
- Parameters:
from- the sourceControlornullto- the destinationControlornullrectangle- to be mapped- Returns:
- rectangle with mapped coordinates
- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the rectangle is null
- ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.1.2
-
mapInPixels
-
map
Maps a point from one coordinate system to another. When the control is null, coordinates are mapped to the display.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. Mapping a point that is the origin of a rectangle and then adding the width and height is not equivalent to mapping the rectangle. When one control is mirrored and the other is not, adding the width and height to a point that was mapped causes the rectangle to extend in the wrong direction. Mapping the entire rectangle instead of just one point causes both the origin and the corner of the rectangle to be mapped.
- Parameters:
from- the sourceControlornullto- the destinationControlornullx- coordinates to be mappedy- coordinates to be mappedwidth- coordinates to be mappedheight- coordinates to be mapped- Returns:
- rectangle with mapped coordinates
- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.1.2
-
mapInPixels
-
mouseHoverProc
long mouseHoverProc(long handle) -
findFocusedWindow
long findFocusedWindow() -
post
Generate a low level system event.postis used to generate low level keyboard and mouse events. The intent is to enable automated UI testing by simulating the input from the user. Most SWT applications should never need to call this method.Note that this operation can fail when the operating system fails to generate the event for any reason. For example, this can happen when there is no such key or mouse button or when the system event queue is full.
Event Types:
KeyDown, KeyUp
The following fields in the
Eventapply:- (in) type KeyDown or KeyUp
Either one of:
- (in) character a character that corresponds to a keyboard key
- (in) keyCode the key code of the key that was typed,
as defined by the key code constants in class
SWT
Optional (on some platforms):
- (in) stateMask the state of the keyboard modifier,
as defined by the key code constants in class
SWT
MouseDown, MouseUp
The following fields in the
Eventapply:- (in) type MouseDown or MouseUp
- (in) button the button that is pressed or released
MouseMove
The following fields in the
Eventapply:- (in) type MouseMove
- (in) x the x coordinate to move the mouse pointer to in screen coordinates
- (in) y the y coordinate to move the mouse pointer to in screen coordinates
MouseWheel
The following fields in the
Eventapply:- (in) type MouseWheel
- (in) detail either SWT.SCROLL_LINE or SWT.SCROLL_PAGE
- (in) count the number of lines or pages to scroll
- Parameters:
event- the event to be generated- Returns:
- true if the event was generated or false otherwise
- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the event is null
SWTException-- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 3.0
-
postEvent
-
putGdkEvents
void putGdkEvents() -
readAndDispatch
public boolean readAndDispatch()Reads an event from the operating system's event queue, dispatches it appropriately, and returnstrueif there is potentially more work to do, orfalseif the caller can sleep until another event is placed on the event queue.In addition to checking the system event queue, this method also checks if any inter-thread messages (created by
syncExec()orasyncExec()) are waiting to be processed, and if so handles them before returning.- Returns:
falseif the caller can sleep upon return from this method- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message
- See Also:
-
register
-
release
protected void release()Releases any internal resources back to the operating system and clears all fields except the device handle.Disposes all shells which are currently open on the display. After this method has been invoked, all related related shells will answer
truewhen sent the messageisDisposed().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
This method is called beforerelease. 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 bydestroy.destroy. -
releaseDisplay
void releaseDisplay() -
removeFilter
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 classSWT.- Parameters:
eventType- the type of event to listen forlistener- the listener which should no longer be notified when the event occurs- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.0
- See Also:
-
removeGdkEvent
long removeGdkEvent() -
removeIdleProc
void removeIdleProc() -
removeListener
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 classSWT.- Parameters:
eventType- the type of event to listen forlistener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.0
- See Also:
-
removeMouseHoverTimeout
void removeMouseHoverTimeout(long handle) -
removePopup
-
removeWidget
-
debugInfoForIndex
-
dpiChanged
void dpiChanged(int newScaleFactor) -
dumpWidgetTableInfo
String dumpWidgetTableInfo() -
runAsyncMessages
boolean runAsyncMessages(boolean all) -
runDeferredEvents
boolean runDeferredEvents() -
runDeferredLayouts
boolean runDeferredLayouts() -
runPopups
boolean runPopups() -
runSettings
boolean runSettings() -
runSkin
boolean runSkin() -
getAppName
Returns the application name.- Returns:
- the application name
- Since:
- 3.6
- See Also:
-
getAppVersion
Returns the application version.- Returns:
- the application version
- Since:
- 3.6
- See Also:
-
setAppName
Sets the application name to the argument.The application name can be used in several ways, depending on the platform and tools being used. Accessibility tools could ask for the application name. On Windows, if the application name is set to any value other than "SWT" (case insensitive), it is used to set the application user model ID which is used by the OS for taskbar grouping.
Specifying
nullfor the name clears it.- Parameters:
name- the new app name ornull- See Also:
-
setAppVersion
Sets the application version to the argument.- Parameters:
version- the new app version- Since:
- 3.6
-
setCursorLocation
public void setCursorLocation(int x, int y) Sets the location of the on-screen pointer relative to the top left corner of the screen. Note: It is typically considered bad practice for a program to move the on-screen pointer location.- Parameters:
x- the new x coordinate for the cursory- the new y coordinate for the cursor- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.1
-
setCursorLocation
Sets the location of the on-screen pointer relative to the top left corner of the screen. Note: It is typically considered bad practice for a program to move the on-screen pointer location.- Parameters:
point- new position- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_NULL_ARGUMENT - if the point is null
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- Since:
- 2.0
-
setData
Sets the application defined property of the receiver with the specified name to the given argument.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
disposeExec()handler which does so.- Parameters:
key- the name of the propertyvalue- the new value for the property- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the key is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
setData
Sets the application defined, display specific data associated with the receiver, to the argument. The display specific data is a single, unnamed field that is stored with every display.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
disposeExec()handler which does so.- Parameters:
data- the new display specific data- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
setDirectionProc
long setDirectionProc(long widget, long direction) -
setModalDialog
-
setModalShell
-
setSynchronizer
Sets the synchronizer used by the display to be the argument, which can not be null.- Parameters:
synchronizer- the new synchronizer for the display (must not be null)- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the synchronizer is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message
-
setRuntimeExceptionHandler
Sets a callback that will be invoked whenever an exception is thrown by a listener or external callback function. The application may use this to set a global exception handling policy: the most common policies are either to log and discard the exception or to re-throw the exception.The default SWT error handling policy is to rethrow exceptions.
- Parameters:
runtimeExceptionHandler- new exception handler to be registered.- Since:
- 3.106
-
getRuntimeExceptionHandler
Returns the current exception handler. It will receive all exceptions thrown by listeners and external callbacks in this display. If code wishes to temporarily replace the exception handler (for example, during a unit test), it is common practice to invoke this method prior to replacing the exception handler so that the old handler may be restored afterward.- Returns:
- the current exception handler. Never
null. - Since:
- 3.106
-
setErrorHandler
Sets a callback that will be invoked whenever an error is thrown by a listener or external callback function. The application may use this to set a global exception handling policy: the most common policies are either to log and discard the exception or to re-throw the exception.The default SWT error handling policy is to rethrow exceptions.
- Parameters:
errorHandler- new error handler to be registered.- Since:
- 3.106
-
getErrorHandler
Returns the current exception handler. It will receive all errors thrown by listeners and external callbacks in this display. If code wishes to temporarily replace the error handler (for example, during a unit test), it is common practice to invoke this method prior to replacing the error handler so that the old handler may be restored afterward.- Returns:
- the current error handler. Never
null. - Since:
- 3.106
-
showIMWindow
-
sleep
public boolean sleep()Causes the user-interface thread to sleep (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.- Returns:
trueif an event requiring dispatching was placed on the queue.- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
timerExec
Causes therun()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.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.
- Parameters:
milliseconds- the delay before running the runnablerunnable- code to run on the user-interface thread- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the runnable is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
timerProc
long timerProc(long i) -
caretProc
long caretProc(long clientData) -
resetCaretTiming
void resetCaretTiming() -
sizeAllocateProc
long sizeAllocateProc(long handle, long arg0, long user_data) -
sizeRequestProc
long sizeRequestProc(long handle, long arg0, long user_data) -
saveResources
void saveResources() -
sendJDKInternalEvent
private void sendJDKInternalEvent(int eventType) -
sendJDKInternalEvent
private void sendJDKInternalEvent(int eventType, int detail) does sent event with JDK time -
sendEvent
-
sendEvent
-
sendPreEvent
void sendPreEvent(int eventType) -
sendPostEvent
void sendPostEvent(int eventType) -
sendPreExternalEventDispatchEvent
public void sendPreExternalEventDispatchEvent()Sends a SWT.PreExternalEventDispatch event. -
sendPostExternalEventDispatchEvent
public void sendPostExternalEventDispatchEvent()Sends a SWT.PostExternalEventDispatch event. -
setCurrentCaret
-
shellMapProc
long shellMapProc(long handle, long arg0, long user_data) -
signalProc
long signalProc(long gobject, long arg1, long user_data) -
syncExec
Causes therun()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. Specifyingnullas the runnable simply wakes the user-interface thread.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.
- Parameters:
runnable- code to run on the user-interface thread ornull- Throws:
SWTException-- ERROR_FAILED_EXEC - if an exception occurred when executing the runnable
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
syncCall
Calls the callable on the user-interface thread at the next reasonable opportunity, and returns the its result from this method. The thread which calls this method is suspended until the callable completes.Note that at the time the callable 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 callable before accessing the widget.
Any exception that is thrown from the callable is re-thrown in the calling thread. Note: The exception retains its original stack trace from the throwing thread. The call to
syncCallwill not be present in the stack trace.- Parameters:
callable- the code to call on the user-interface thread- Throws:
SWTException-ERROR_DEVICE_DISPOSED- if the receiver has been disposedE- An exception that is thrown by the callable on the user-interface thread, and re-thrown on the calling thread- Since:
- 3.118
- See Also:
-
translateKey
static int translateKey(int key) -
untranslateKey
static int untranslateKey(int key) -
update
public void update()Forces all outstanding paint requests for the display to be processed before this method returns.- Throws:
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
wake
public void wake()If the receiver's user-interface thread wassleeping, causes it to be awakened and start running again. Note that this method may be called from any thread.- Throws:
SWTException-- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- See Also:
-
wakeThread
void wakeThread() -
enterMotionProc
void enterMotionProc(long controller, double x, double y, long user_data) -
scrollProc
boolean scrollProc(long controller, double dx, double dy, long user_data) -
focusProc
void focusProc(long controller, long user_data) -
windowActiveProc
void windowActiveProc(long handle, long user_data) -
keyPressReleaseProc
boolean keyPressReleaseProc(long controller, int keyval, int keycode, int state, long user_data) -
gesturePressReleaseProc
void gesturePressReleaseProc(long gesture, int n_press, double x, double y, long user_data) -
leaveProc
void leaveProc(long controller, long user_data) -
computeSizeProc
void computeSizeProc(long toplevel, long size, long user_data) -
activateProc
void activateProc(long action, long parameter, long user_data) -
resizeProc
void resizeProc(long handle, int width, int height) -
notifyProc
long notifyProc(long object, long param_spec, long user_data) -
changeValue
boolean changeValue(long handle, int scroll, double value, long user_data) -
windowProc
long windowProc(long handle, long user_data) -
windowProc
long windowProc(long handle, long arg0, long user_data) -
windowProc
long windowProc(long handle, long arg0, long arg1, long user_data) -
windowProc
long windowProc(long handle, long arg0, long arg1, long arg2, long user_data) -
windowProc
long windowProc(long handle, long arg0, long arg1, long arg2, long arg3, long user_data) -
windowTimerProc
long windowTimerProc(long handle) -
getWindowPointerPosition
long getWindowPointerPosition(long window, int[] x, int[] y, int[] mask) Gets the current cursor position relative to the upper left corner of the window. Available to GTK3 implementations only.- Returns:
- the cursor position to x invalid input: '&' y. Return value of the function is the window pointer underneath the cursor, can be NULL.
-
getPointerPosition
void getPointerPosition(double[] x, double[] y) Gets the current cursor position relative to the upper left corner of the surface. Available to GTK4 implementations only. -
gdk_device_get_window_at_position
long gdk_device_get_window_at_position(int[] win_x, int[] win_y) -
gdk_device_get_surface_at_position
long gdk_device_get_surface_at_position(double[] win_x, double[] win_y) -
_getDeviceZoom
static int _getDeviceZoom(long monitor_num) -
isActivateShellOnForceFocus
static boolean isActivateShellOnForceFocus() -
isRescalingAtRuntime
public boolean isRescalingAtRuntime()Returns whether rescaling of shells at runtime when the DPI scaling of a shell's monitor changes is activated for this device.Note: This functionality is only available on Windows. Calling this method on other operating system will always return false.
- Returns:
- whether rescaling of shells at runtime when the DPI scaling of a shell's monitor changes is activated for this device
- Since:
- 3.127
-
setRescalingAtRuntime
@Deprecated(since="2025-03", forRemoval=true) public boolean setRescalingAtRuntime(boolean activate) Deprecated, for removal: This API element is subject to removal in a future version.this method should not be used as it needs to be called already during instantiation to take proper effectActivates or deactivates rescaling of shells at runtime whenever the DPI scaling of the shell's monitor changes. This is only safe to call as long as no shell has been created for this display. When changing the value after a shell has been created for this display, the effect is undefined.Note: This functionality is only available on Windows. Calling this method on other operating system will have no effect.
- Parameters:
activate- whether rescaling shall be activated or deactivated- Returns:
- whether activating or deactivating the rescaling was successful
- Since:
- 3.127
-